Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
99bbc781
Commit
99bbc781
authored
Mar 01, 2011
by
Baptiste Coudurier
Committed by
Mans Rullgard
Mar 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnxhd: allow encoding with Avid Nitris compatibility.
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
fffdee89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
dnxhdenc.c
libavcodec/dnxhdenc.c
+15
-1
dnxhdenc.h
libavcodec/dnxhdenc.h
+3
-0
No files found.
libavcodec/dnxhdenc.c
View file @
99bbc781
...
...
@@ -24,11 +24,20 @@
//#define DEBUG
#define RC_VARIANCE 1 // use variance or ssd for fast rc
#include "libavutil/opt.h"
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#include "dnxhdenc.h"
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static
const
AVOption
options
[]
=
{
{
"nitris_compat"
,
"encode with Avid Nitris compatibility"
,
offsetof
(
DNXHDEncContext
,
nitris_compat
),
FF_OPT_TYPE_INT
,
0
,
0
,
1
,
VE
},
{
NULL
}
};
static
const
AVClass
class
=
{
"dnxhd"
,
av_default_item_name
,
options
,
LIBAVUTIL_VERSION_INT
};
int
dct_quantize_c
(
MpegEncContext
*
s
,
DCTELEM
*
block
,
int
n
,
int
qscale
,
int
*
overflow
);
#define LAMBDA_FRAC_BITS 10
...
...
@@ -146,7 +155,7 @@ static int dnxhd_init_rc(DNXHDEncContext *ctx)
if
(
ctx
->
m
.
avctx
->
mb_decision
!=
FF_MB_DECISION_RD
)
FF_ALLOCZ_OR_GOTO
(
ctx
->
m
.
avctx
,
ctx
->
mb_cmp
,
ctx
->
m
.
mb_num
*
sizeof
(
RCCMPEntry
),
fail
);
ctx
->
frame_bits
=
(
ctx
->
cid_table
->
coding_unit_size
-
640
-
4
)
*
8
;
ctx
->
frame_bits
=
(
ctx
->
cid_table
->
coding_unit_size
-
640
-
4
-
ctx
->
min_padding
)
*
8
;
ctx
->
qscale
=
1
;
ctx
->
lambda
=
2
<<
LAMBDA_FRAC_BITS
;
// qscale 2
return
0
;
...
...
@@ -198,6 +207,10 @@ static int dnxhd_encode_init(AVCodecContext *avctx)
if
(
dnxhd_init_qmat
(
ctx
,
ctx
->
m
.
intra_quant_bias
,
0
)
<
0
)
// XXX tune lbias/cbias
return
-
1
;
// Avid Nitris hardware decoder requires a minimum amount of padding in the coding unit payload
if
(
ctx
->
nitris_compat
)
ctx
->
min_padding
=
1600
;
if
(
dnxhd_init_vlc
(
ctx
)
<
0
)
return
-
1
;
if
(
dnxhd_init_rc
(
ctx
)
<
0
)
...
...
@@ -858,4 +871,5 @@ AVCodec ff_dnxhd_encoder = {
dnxhd_encode_end
,
.
pix_fmts
=
(
const
enum
PixelFormat
[]){
PIX_FMT_YUV422P
,
PIX_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"VC3/DNxHD"
),
.
priv_class
=
&
class
,
};
libavcodec/dnxhdenc.h
View file @
99bbc781
...
...
@@ -55,6 +55,9 @@ typedef struct DNXHDEncContext {
int
interlaced
;
int
cur_field
;
int
nitris_compat
;
unsigned
min_padding
;
DECLARE_ALIGNED
(
16
,
DCTELEM
,
blocks
)[
8
][
64
];
int
(
*
qmatrix_c
)
[
64
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment