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
89829242
Commit
89829242
authored
Feb 11, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnxhdenc: switch to encode2.
parent
3f77c411
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
dnxhdenc.c
libavcodec/dnxhdenc.c
+12
-7
No files found.
libavcodec/dnxhdenc.c
View file @
89829242
...
...
@@ -29,6 +29,7 @@
#include "libavutil/opt.h"
#include "avcodec.h"
#include "dsputil.h"
#include "internal.h"
#include "mpegvideo.h"
#include "mpegvideo_common.h"
#include "dnxhdenc.h"
...
...
@@ -903,18 +904,21 @@ static void dnxhd_load_picture(DNXHDEncContext *ctx, const AVFrame *frame)
ctx
->
cur_field
=
frame
->
interlaced_frame
&&
!
frame
->
top_field_first
;
}
static
int
dnxhd_encode_picture
(
AVCodecContext
*
avctx
,
unsigned
char
*
buf
,
int
buf_size
,
void
*
data
)
static
int
dnxhd_encode_picture
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
const
AVFrame
*
frame
,
int
*
got_packet
)
{
DNXHDEncContext
*
ctx
=
avctx
->
priv_data
;
int
first_field
=
1
;
int
offset
,
i
,
ret
;
uint8_t
*
buf
;
if
(
buf_size
<
ctx
->
cid_table
->
frame_size
)
{
if
(
(
ret
=
ff_alloc_packet
(
pkt
,
ctx
->
cid_table
->
frame_size
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"output buffer is too small to compress picture
\n
"
);
return
-
1
;
return
ret
;
}
buf
=
pkt
->
data
;
dnxhd_load_picture
(
ctx
,
data
);
dnxhd_load_picture
(
ctx
,
frame
);
encode_coding_unit:
for
(
i
=
0
;
i
<
3
;
i
++
)
{
...
...
@@ -955,13 +959,14 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, unsigned char *buf, int b
first_field
=
0
;
ctx
->
cur_field
^=
1
;
buf
+=
ctx
->
cid_table
->
coding_unit_size
;
buf_size
-=
ctx
->
cid_table
->
coding_unit_size
;
goto
encode_coding_unit
;
}
ctx
->
frame
.
quality
=
ctx
->
qscale
*
FF_QP2LAMBDA
;
return
ctx
->
cid_table
->
frame_size
;
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
*
got_packet
=
1
;
return
0
;
}
static
int
dnxhd_encode_end
(
AVCodecContext
*
avctx
)
...
...
@@ -999,7 +1004,7 @@ AVCodec ff_dnxhd_encoder = {
.
id
=
CODEC_ID_DNXHD
,
.
priv_data_size
=
sizeof
(
DNXHDEncContext
),
.
init
=
dnxhd_encode_init
,
.
encode
=
dnxhd_encode_picture
,
.
encode
2
=
dnxhd_encode_picture
,
.
close
=
dnxhd_encode_end
,
.
capabilities
=
CODEC_CAP_SLICE_THREADS
,
.
pix_fmts
=
(
const
enum
PixelFormat
[]){
PIX_FMT_YUV422P
,
PIX_FMT_YUV422P10
,
PIX_FMT_NONE
},
...
...
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