FFmpeg
Loading...
Searching...
No Matches
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
30
31#include "mpegvideoenc.h"
32#include "dnxhddata.h"
33
34typedef struct RCCMPEntry {
35 uint32_t mb;
36 int value;
38
39typedef struct RCEntry {
40 int ssd;
41 int bits;
42} RCEntry;
43
44typedef struct DNXHDEncContext {
45 AVClass *class;
46 MPVEncContext m; ///< Used for quantization dsp functions
47
48 int cid;
51 int is_444;
53 uint8_t *msip; ///< Macroblock Scan Indexes Payload
54 uint32_t *slice_size;
55 uint32_t *slice_offs;
56
58
59 // Because our samples are either 8 or 16 bits for 8-bit and 10-bit
60 // encoding respectively, these refer either to bytes or to two-byte words.
61 unsigned dct_y_offset;
62 unsigned dct_uv_offset;
64
68
71
73 unsigned min_padding;
75
76 DECLARE_ALIGNED(32, int16_t, blocks)[12][64];
77 DECLARE_ALIGNED(16, uint8_t, edge_buf_y)[512]; // has to hold 16x16 uint16 when depth=10
78 DECLARE_ALIGNED(16, uint8_t, edge_buf_uv)[2][512]; // has to hold 16x16 uint16_t when depth=10
79
80 int (*qmatrix_c) [64];
81 int (*qmatrix_l) [64];
82 uint16_t (*qmatrix_l16)[2][64];
83 uint16_t (*qmatrix_c16)[2][64];
84
85 unsigned frame_bits;
86 const uint8_t *src[3];
87
88 uint32_t *orig_vlc_codes;
89 uint8_t *orig_vlc_bits;
90 uint32_t *vlc_codes;
91 uint8_t *vlc_bits;
92 uint16_t *run_codes;
93 uint8_t *run_bits;
94
95 /** Rate control */
96 unsigned slice_bits;
97 unsigned qscale;
98 unsigned lambda;
99
100 uint32_t *mb_bits;
101 uint8_t *mb_qscale;
102
106
107 void (*get_pixels_8x4_sym)(int16_t *restrict /* align 16 */ block,
108 const uint8_t *pixels, ptrdiff_t line_size);
110
113
114#endif /* AVCODEC_DNXHDENC_H */
static int16_t block[64]
Definition dct.c:125
void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
void ff_dnxhdenc_init(DNXHDEncContext *ctx)
Definition dnxhdenc.c:1364
#define MAX_THREADS
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
mpegvideo header.
Describe the class of an AVClass context structure.
Definition log.h:76
uint8_t * run_bits
Definition dnxhdenc.h:93
uint32_t * slice_offs
Definition dnxhdenc.h:55
unsigned min_padding
Definition dnxhdenc.h:73
uint8_t edge_buf_y[512]
Definition dnxhdenc.h:77
struct DNXHDEncContext * thread[MAX_THREADS]
Definition dnxhdenc.h:57
uint8_t * orig_vlc_bits
Definition dnxhdenc.h:89
int intra_quant_bias
Definition dnxhdenc.h:74
uint32_t * vlc_codes
Definition dnxhdenc.h:90
RCEntry * mb_rc
Definition dnxhdenc.h:105
unsigned slice_bits
Rate control.
Definition dnxhdenc.h:96
MPVEncContext m
Used for quantization dsp functions.
Definition dnxhdenc.h:46
uint32_t * mb_bits
Definition dnxhdenc.h:100
unsigned lambda
Definition dnxhdenc.h:98
int16_t blocks[12][64]
Definition dnxhdenc.h:76
uint8_t * msip
Macroblock Scan Indexes Payload.
Definition dnxhdenc.h:53
void(* get_pixels_8x4_sym)(int16_t *restrict block, const uint8_t *pixels, ptrdiff_t line_size)
Definition dnxhdenc.h:107
int coding_unit_size
Definition dnxhdenc.h:66
unsigned qscale
Definition dnxhdenc.h:97
RCCMPEntry * mb_cmp_tmp
Definition dnxhdenc.h:104
const uint8_t * src[3]
Definition dnxhdenc.h:86
unsigned block_width_l2
Definition dnxhdenc.h:63
uint32_t * slice_size
Definition dnxhdenc.h:54
int(* qmatrix_l)[64]
Definition dnxhdenc.h:81
uint8_t edge_buf_uv[2][512]
Definition dnxhdenc.h:78
uint8_t * vlc_bits
Definition dnxhdenc.h:91
unsigned dct_uv_offset
Definition dnxhdenc.h:62
uint16_t(* qmatrix_l16)[2][64]
Definition dnxhdenc.h:82
uint16_t(* qmatrix_c16)[2][64]
Definition dnxhdenc.h:83
unsigned frame_bits
Definition dnxhdenc.h:85
unsigned dct_y_offset
Definition dnxhdenc.h:61
int(* qmatrix_c)[64]
Definition dnxhdenc.h:80
const CIDEntry * cid_table
Definition dnxhdenc.h:52
uint8_t * mb_qscale
Definition dnxhdenc.h:101
RCCMPEntry * mb_cmp
Definition dnxhdenc.h:103
uint32_t * orig_vlc_codes
Definition dnxhdenc.h:88
uint16_t * run_codes
Definition dnxhdenc.h:92
uint32_t mb
Definition dnxhdenc.h:35
int value
Definition dnxhdenc.h:36
int bits
Definition dnxhdenc.h:41
int ssd
Definition dnxhdenc.h:40
static AVFormatContext * ctx
Definition movenc.c:49