yading@10
|
1 /*
|
yading@10
|
2 * MJPEG encoder
|
yading@10
|
3 * Copyright (c) 2000, 2001 Fabrice Bellard
|
yading@10
|
4 * Copyright (c) 2003 Alex Beregszaszi
|
yading@10
|
5 * Copyright (c) 2003-2004 Michael Niedermayer
|
yading@10
|
6 *
|
yading@10
|
7 * Support for external huffman table, various fixes (AVID workaround),
|
yading@10
|
8 * aspecting, new decode_frame mechanism and apple mjpeg-b support
|
yading@10
|
9 * by Alex Beregszaszi
|
yading@10
|
10 *
|
yading@10
|
11 * This file is part of FFmpeg.
|
yading@10
|
12 *
|
yading@10
|
13 * FFmpeg is free software; you can redistribute it and/or
|
yading@10
|
14 * modify it under the terms of the GNU Lesser General Public
|
yading@10
|
15 * License as published by the Free Software Foundation; either
|
yading@10
|
16 * version 2.1 of the License, or (at your option) any later version.
|
yading@10
|
17 *
|
yading@10
|
18 * FFmpeg is distributed in the hope that it will be useful,
|
yading@10
|
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
yading@10
|
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
yading@10
|
21 * Lesser General Public License for more details.
|
yading@10
|
22 *
|
yading@10
|
23 * You should have received a copy of the GNU Lesser General Public
|
yading@10
|
24 * License along with FFmpeg; if not, write to the Free Software
|
yading@10
|
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
yading@10
|
26 */
|
yading@10
|
27
|
yading@10
|
28 /**
|
yading@10
|
29 * @file
|
yading@10
|
30 * MJPEG encoder.
|
yading@10
|
31 */
|
yading@10
|
32
|
yading@10
|
33 #ifndef AVCODEC_MJPEGENC_H
|
yading@10
|
34 #define AVCODEC_MJPEGENC_H
|
yading@10
|
35
|
yading@10
|
36 #include <stdint.h>
|
yading@10
|
37
|
yading@10
|
38 #include "mpegvideo.h"
|
yading@10
|
39
|
yading@10
|
40 typedef struct MJpegContext {
|
yading@10
|
41 uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing
|
yading@10
|
42 uint16_t huff_code_dc_luminance[12];
|
yading@10
|
43 uint8_t huff_size_dc_chrominance[12];
|
yading@10
|
44 uint16_t huff_code_dc_chrominance[12];
|
yading@10
|
45
|
yading@10
|
46 uint8_t huff_size_ac_luminance[256];
|
yading@10
|
47 uint16_t huff_code_ac_luminance[256];
|
yading@10
|
48 uint8_t huff_size_ac_chrominance[256];
|
yading@10
|
49 uint16_t huff_code_ac_chrominance[256];
|
yading@10
|
50 } MJpegContext;
|
yading@10
|
51
|
yading@10
|
52 int ff_mjpeg_encode_init(MpegEncContext *s);
|
yading@10
|
53 void ff_mjpeg_encode_close(MpegEncContext *s);
|
yading@10
|
54 void ff_mjpeg_encode_picture_header(MpegEncContext *s);
|
yading@10
|
55 void ff_mjpeg_encode_picture_trailer(MpegEncContext *s);
|
yading@10
|
56 void ff_mjpeg_encode_stuffing(MpegEncContext *s);
|
yading@10
|
57 void ff_mjpeg_encode_dc(MpegEncContext *s, int val,
|
yading@10
|
58 uint8_t *huff_size, uint16_t *huff_code);
|
yading@10
|
59 void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]);
|
yading@10
|
60
|
yading@10
|
61 #endif /* AVCODEC_MJPEGENC_H */
|