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 "config.h"
30 
31 #include "mpegvideo.h"
32 #include "dnxhddata.h"
33 
34 typedef struct RCCMPEntry {
35  uint16_t mb;
36  int value;
37 } RCCMPEntry;
38 
39 typedef struct RCEntry {
40  int ssd;
41  int bits;
42 } RCEntry;
43 
44 typedef struct DNXHDEncContext {
45  AVClass *class;
47  MpegEncContext m; ///< Used for quantization dsp functions
48 
49  int cid;
50  int profile;
51  int bit_depth;
52  int is_444;
54  uint8_t *msip; ///< Macroblock Scan Indexes Payload
55  uint32_t *slice_size;
56  uint32_t *slice_offs;
57 
59 
60  // Because our samples are either 8 or 16 bits for 8-bit and 10-bit
61  // encoding respectively, these refer either to bytes or to two-byte words.
62  unsigned dct_y_offset;
63  unsigned dct_uv_offset;
64  unsigned block_width_l2;
65 
69 
71  int cur_field;
72 
74  unsigned min_padding;
76 
77  DECLARE_ALIGNED(16, int16_t, blocks)[12][64];
80 
81  int (*qmatrix_c) [64];
82  int (*qmatrix_l) [64];
83  uint16_t (*qmatrix_l16)[2][64];
84  uint16_t (*qmatrix_c16)[2][64];
85 
86  unsigned frame_bits;
87  uint8_t *src[3];
88 
89  uint32_t *vlc_codes;
91  uint16_t *run_codes;
93 
94  /** Rate control */
95  unsigned slice_bits;
96  unsigned qscale;
97  unsigned lambda;
98 
99  uint16_t *mb_bits;
101 
105 
106  void (*get_pixels_8x4_sym)(int16_t *av_restrict /* align 16 */ block,
107  const uint8_t *pixels, ptrdiff_t line_size);
109 
111 
112 #endif /* AVCODEC_DNXHDENC_H */
int16_t blocks[12][64]
Definition: dnxhdenc.h:77
RCCMPEntry * mb_cmp_tmp
Definition: dnxhdenc.h:103
RCEntry * mb_rc
Definition: dnxhdenc.h:104
int(* qmatrix_l)[64]
Definition: dnxhdenc.h:82
unsigned dct_uv_offset
Definition: dnxhdenc.h:63
mpegvideo header.
struct DNXHDEncContext * thread[MAX_THREADS]
Definition: dnxhdenc.h:58
static int16_t block[64]
Definition: dct.c:115
int coding_unit_size
Definition: dnxhdenc.h:67
int intra_quant_bias
Definition: dnxhdenc.h:75
uint8_t
uint32_t * slice_size
Definition: dnxhdenc.h:55
int(* qmatrix_c)[64]
Definition: dnxhdenc.h:81
uint32_t * slice_offs
Definition: dnxhdenc.h:56
unsigned qscale
Definition: dnxhdenc.h:96
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
Definition: mem.h:104
BlockDSPContext bdsp
Definition: dnxhdenc.h:46
unsigned slice_bits
Rate control.
Definition: dnxhdenc.h:95
uint16_t * run_codes
Definition: dnxhdenc.h:91
#define MAX_THREADS
MpegEncContext m
Used for quantization dsp functions.
Definition: dnxhdenc.h:47
uint8_t * run_bits
Definition: dnxhdenc.h:92
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
unsigned frame_bits
Definition: dnxhdenc.h:86
AVFormatContext * ctx
Definition: movenc.c:48
uint16_t(* qmatrix_l16)[2][64]
Definition: dnxhdenc.h:83
uint8_t * msip
Macroblock Scan Indexes Payload.
Definition: dnxhdenc.h:54
int value
Definition: dnxhdenc.h:36
uint8_t * vlc_bits
Definition: dnxhdenc.h:90
uint8_t edge_buf_uv[2][256]
Definition: dnxhdenc.h:79
unsigned block_width_l2
Definition: dnxhdenc.h:64
unsigned lambda
Definition: dnxhdenc.h:97
uint8_t edge_buf_y[256]
Definition: dnxhdenc.h:78
void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
Definition: dnxhdenc_init.c:31
Describe the class of an AVClass context structure.
Definition: log.h:67
int ssd
Definition: dnxhdenc.h:40
const CIDEntry * cid_table
Definition: dnxhdenc.h:53
uint16_t(* qmatrix_c16)[2][64]
Definition: dnxhdenc.h:84
unsigned dct_y_offset
Definition: dnxhdenc.h:62
unsigned min_padding
Definition: dnxhdenc.h:74
uint16_t * mb_bits
Definition: dnxhdenc.h:99
MpegEncContext.
Definition: mpegvideo.h:78
int
RCCMPEntry * mb_cmp
Definition: dnxhdenc.h:102
int pixels
Definition: avisynth_c.h:429
int nitris_compat
Definition: dnxhdenc.h:73
void(* get_pixels_8x4_sym)(int16_t *av_restrictblock, const uint8_t *pixels, ptrdiff_t line_size)
Definition: dnxhdenc.h:106
int bits
Definition: dnxhdenc.h:41
uint16_t mb
Definition: dnxhdenc.h:35
uint32_t * vlc_codes
Definition: dnxhdenc.h:89
uint8_t * src[3]
Definition: dnxhdenc.h:87
uint8_t * mb_qscale
Definition: dnxhdenc.h:100