00001 /* 00002 * MJPEG encoder 00003 * Copyright (c) 2000, 2001 Fabrice Bellard 00004 * Copyright (c) 2003 Alex Beregszaszi 00005 * Copyright (c) 2003-2004 Michael Niedermayer 00006 * 00007 * Support for external huffman table, various fixes (AVID workaround), 00008 * aspecting, new decode_frame mechanism and apple mjpeg-b support 00009 * by Alex Beregszaszi 00010 * 00011 * This file is part of FFmpeg. 00012 * 00013 * FFmpeg is free software; you can redistribute it and/or 00014 * modify it under the terms of the GNU Lesser General Public 00015 * License as published by the Free Software Foundation; either 00016 * version 2.1 of the License, or (at your option) any later version. 00017 * 00018 * FFmpeg is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 * Lesser General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public 00024 * License along with FFmpeg; if not, write to the Free Software 00025 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00026 */ 00027 00033 #ifndef AVCODEC_MJPEGENC_H 00034 #define AVCODEC_MJPEGENC_H 00035 00036 #include "dsputil.h" 00037 #include "mpegvideo.h" 00038 00039 typedef struct MJpegContext { 00040 uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing 00041 uint16_t huff_code_dc_luminance[12]; 00042 uint8_t huff_size_dc_chrominance[12]; 00043 uint16_t huff_code_dc_chrominance[12]; 00044 00045 uint8_t huff_size_ac_luminance[256]; 00046 uint16_t huff_code_ac_luminance[256]; 00047 uint8_t huff_size_ac_chrominance[256]; 00048 uint16_t huff_code_ac_chrominance[256]; 00049 } MJpegContext; 00050 00051 int ff_mjpeg_encode_init(MpegEncContext *s); 00052 void ff_mjpeg_encode_close(MpegEncContext *s); 00053 void ff_mjpeg_encode_picture_header(MpegEncContext *s); 00054 void ff_mjpeg_encode_picture_trailer(MpegEncContext *s); 00055 void ff_mjpeg_encode_stuffing(PutBitContext *pbc); 00056 void ff_mjpeg_encode_dc(MpegEncContext *s, int val, 00057 uint8_t *huff_size, uint16_t *huff_code); 00058 void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]); 00059 00060 #endif /* AVCODEC_MJPEGENC_H */