yading@10: /* yading@10: * MJPEG encoder yading@10: * Copyright (c) 2000, 2001 Fabrice Bellard yading@10: * Copyright (c) 2003 Alex Beregszaszi yading@10: * Copyright (c) 2003-2004 Michael Niedermayer yading@10: * yading@10: * Support for external huffman table, various fixes (AVID workaround), yading@10: * aspecting, new decode_frame mechanism and apple mjpeg-b support yading@10: * by Alex Beregszaszi yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: /** yading@10: * @file yading@10: * MJPEG encoder. yading@10: */ yading@10: yading@10: #ifndef AVCODEC_MJPEGENC_H yading@10: #define AVCODEC_MJPEGENC_H yading@10: yading@10: #include yading@10: yading@10: #include "mpegvideo.h" yading@10: yading@10: typedef struct MJpegContext { yading@10: uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing yading@10: uint16_t huff_code_dc_luminance[12]; yading@10: uint8_t huff_size_dc_chrominance[12]; yading@10: uint16_t huff_code_dc_chrominance[12]; yading@10: yading@10: uint8_t huff_size_ac_luminance[256]; yading@10: uint16_t huff_code_ac_luminance[256]; yading@10: uint8_t huff_size_ac_chrominance[256]; yading@10: uint16_t huff_code_ac_chrominance[256]; yading@10: } MJpegContext; yading@10: yading@10: int ff_mjpeg_encode_init(MpegEncContext *s); yading@10: void ff_mjpeg_encode_close(MpegEncContext *s); yading@10: void ff_mjpeg_encode_picture_header(MpegEncContext *s); yading@10: void ff_mjpeg_encode_picture_trailer(MpegEncContext *s); yading@10: void ff_mjpeg_encode_stuffing(MpegEncContext *s); yading@10: void ff_mjpeg_encode_dc(MpegEncContext *s, int val, yading@10: uint8_t *huff_size, uint16_t *huff_code); yading@10: void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]); yading@10: yading@10: #endif /* AVCODEC_MJPEGENC_H */