comparison mjpegenc.h @ 5028:3d8a813666e4 libavcodec

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