FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dnxhdenc.h
Go to the documentation of this file.
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 
29 #include "mpegvideo.h"
30 #include "dnxhddata.h"
31 
32 typedef struct RCCMPEntry {
33  uint16_t mb;
34  int value;
35 } RCCMPEntry;
36 
37 typedef struct RCEntry {
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  int cid;
48  uint8_t *msip; ///< Macroblock Scan Indexes Payload
49  uint32_t *slice_size;
50  uint32_t *slice_offs;
51 
53 
54  // Because our samples are either 8 or 16 bits for 8-bit and 10-bit
55  // encoding respectively, these refer either to bytes or to two-byte words.
56  unsigned dct_y_offset;
57  unsigned dct_uv_offset;
58  unsigned block_width_l2;
59 
61  int cur_field;
62 
64  unsigned min_padding;
65 
66  DECLARE_ALIGNED(16, int16_t, blocks)[8][64];
67 
68  int (*qmatrix_c) [64];
69  int (*qmatrix_l) [64];
70  uint16_t (*qmatrix_l16)[2][64];
71  uint16_t (*qmatrix_c16)[2][64];
72 
73  unsigned frame_bits;
74  uint8_t *src[3];
75 
76  uint32_t *vlc_codes;
78  uint16_t *run_codes;
80 
81  /** Rate control */
82  unsigned slice_bits;
83  unsigned qscale;
84  unsigned lambda;
85 
86  uint16_t *mb_bits;
88 
90  RCEntry (*mb_rc)[8160];
91 
92  void (*get_pixels_8x4_sym)(int16_t * /*align 16*/, const uint8_t *, int);
94 
96 
97 #endif /* AVCODEC_DNXHDENC_H */