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