]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blob - libavcodec/dnxhdenc.h
frsh: Export information about the last RTP contract and VRES
[frescor/ffmpeg.git] / libavcodec / dnxhdenc.h
1 /*
2  * VC3/DNxHD encoder structure definitions and prototypes
3  * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
4  *
5  * VC-3 encoder funded by the British Broadcasting Corporation
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
24 #ifndef AVCODEC_DNXHDENC_H
25 #define AVCODEC_DNXHDENC_H
26
27 #include <stdint.h>
28 #include "libavcodec/mpegvideo.h"
29 #include "libavcodec/dnxhddata.h"
30
31 typedef struct {
32     uint16_t mb;
33     int value;
34 } RCCMPEntry;
35
36 typedef struct {
37     int ssd;
38     int bits;
39 } RCEntry;
40
41 typedef struct DNXHDEncContext {
42     MpegEncContext m; ///< Used for quantization dsp functions
43
44     AVFrame frame;
45     int cid;
46     const CIDEntry *cid_table;
47     uint8_t *msip; ///< Macroblock Scan Indexes Payload
48     uint32_t *slice_size;
49
50     struct DNXHDEncContext *thread[MAX_THREADS];
51
52     unsigned dct_y_offset;
53     unsigned dct_uv_offset;
54     int interlaced;
55     int cur_field;
56
57     DECLARE_ALIGNED_16(DCTELEM, blocks[8][64]);
58
59     int      (*qmatrix_c)     [64];
60     int      (*qmatrix_l)     [64];
61     uint16_t (*qmatrix_l16)[2][64];
62     uint16_t (*qmatrix_c16)[2][64];
63
64     unsigned frame_bits;
65     uint8_t *src[3];
66
67     uint32_t *vlc_codes;
68     uint8_t  *vlc_bits;
69     uint16_t *run_codes;
70     uint8_t  *run_bits;
71
72     /** Rate control */
73     unsigned slice_bits;
74     unsigned qscale;
75     unsigned lambda;
76
77     unsigned thread_size;
78
79     uint16_t *mb_bits;
80     uint8_t  *mb_qscale;
81
82     RCCMPEntry *mb_cmp;
83     RCEntry   (*mb_rc)[8160];
84
85     void (*get_pixels_8x4_sym)(DCTELEM */*align 16*/, const uint8_t *, int);
86 } DNXHDEncContext;
87
88 void ff_dnxhd_init_mmx(DNXHDEncContext *ctx);
89
90 #endif /* AVCODEC_DNXHDENC_H */