FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mjpegenc.h
Go to the documentation of this file.
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  * Support for external huffman table, various fixes (AVID workaround),
8  * aspecting, new decode_frame mechanism and apple mjpeg-b support
9  * by Alex Beregszaszi
10  *
11  * This file is part of FFmpeg.
12  *
13  * FFmpeg is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Lesser General Public
15  * License as published by the Free Software Foundation; either
16  * version 2.1 of the License, or (at your option) any later version.
17  *
18  * FFmpeg is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  * Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public
24  * License along with FFmpeg; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26  */
27 
28 /**
29  * @file
30  * MJPEG encoder.
31  */
32 
33 #ifndef AVCODEC_MJPEGENC_H
34 #define AVCODEC_MJPEGENC_H
35 
36 #include <stdint.h>
37 
38 #include "mjpeg.h"
39 #include "mpegvideo.h"
40 #include "put_bits.h"
41 
42 typedef struct MJpegContext {
43  uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing
44  uint16_t huff_code_dc_luminance[12];
47 
49  uint16_t huff_code_ac_luminance[256];
51  uint16_t huff_code_ac_chrominance[256];
52 } MJpegContext;
53 
54 static inline void put_marker(PutBitContext *p, enum JpegMarker code)
55 {
56  put_bits(p, 8, 0xff);
57  put_bits(p, 8, code);
58 }
59 
62 void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]);
63 
64 #endif /* AVCODEC_MJPEGENC_H */
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64])
Definition: mjpegenc.c:179
const char * s
Definition: avisynth_c.h:631
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
Definition: j2kenc.c:167
mpegvideo header.
MJPEG encoder and decoder.
uint16_t huff_code_dc_chrominance[12]
Definition: mjpegenc.h:46
uint16_t huff_code_ac_luminance[256]
Definition: mjpegenc.h:49
uint8_t
uint8_t huff_size_dc_chrominance[12]
Definition: mjpegenc.h:45
uint16_t huff_code_ac_chrominance[256]
Definition: mjpegenc.h:51
uint8_t huff_size_ac_luminance[256]
Definition: mjpegenc.h:48
uint8_t huff_size_ac_chrominance[256]
Definition: mjpegenc.h:50
static void put_marker(PutBitContext *p, enum JpegMarker code)
Definition: mjpegenc.h:54
void ff_mjpeg_encode_close(MpegEncContext *s)
Definition: mjpegenc.c:116
int ff_mjpeg_encode_init(MpegEncContext *s)
Definition: mjpegenc.c:71
MpegEncContext.
Definition: mpegvideo.h:88
uint16_t huff_code_dc_luminance[12]
Definition: mjpegenc.h:44
uint8_t huff_size_dc_luminance[12]
Definition: mjpegenc.h:43
JpegMarker
Definition: mjpeg.h:37
bitstream writer API
static int16_t block[64]
Definition: dct-test.c:110