]> git.sesse.net Git - ffmpeg/blob - libavcodec/dnxhdenc.h
mpeg4videoenc: Remove disabled variant of mpeg4_encode_block().
[ffmpeg] / 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 Libav.
8  *
9  * Libav 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  * Libav 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 Libav; 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
29 #include "mpegvideo.h"
30 #include "dnxhddata.h"
31
32 typedef struct {
33     uint16_t mb;
34     int value;
35 } RCCMPEntry;
36
37 typedef struct {
38     int ssd;
39     int bits;
40 } RCEntry;
41
42 typedef struct DNXHDEncContext {
43     AVClass *class;
44     MpegEncContext m; ///< Used for quantization dsp functions
45
46     AVFrame frame;
47     int cid;
48     const CIDEntry *cid_table;
49     uint8_t *msip; ///< Macroblock Scan Indexes Payload
50     uint32_t *slice_size;
51     uint32_t *slice_offs;
52
53     struct DNXHDEncContext *thread[MAX_THREADS];
54
55     unsigned dct_y_offset;
56     unsigned dct_uv_offset;
57     int interlaced;
58     int cur_field;
59
60     int nitris_compat;
61     unsigned min_padding;
62
63     DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64];
64
65     int      (*qmatrix_c)     [64];
66     int      (*qmatrix_l)     [64];
67     uint16_t (*qmatrix_l16)[2][64];
68     uint16_t (*qmatrix_c16)[2][64];
69
70     unsigned frame_bits;
71     uint8_t *src[3];
72
73     uint32_t *vlc_codes;
74     uint8_t  *vlc_bits;
75     uint16_t *run_codes;
76     uint8_t  *run_bits;
77
78     /** Rate control */
79     unsigned slice_bits;
80     unsigned qscale;
81     unsigned lambda;
82
83     unsigned thread_size;
84
85     uint16_t *mb_bits;
86     uint8_t  *mb_qscale;
87
88     RCCMPEntry *mb_cmp;
89     RCEntry   (*mb_rc)[8160];
90
91     void (*get_pixels_8x4_sym)(DCTELEM */*align 16*/, const uint8_t *, int);
92 } DNXHDEncContext;
93
94 void ff_dnxhd_init_mmx(DNXHDEncContext *ctx);
95
96 #endif /* AVCODEC_DNXHDENC_H */