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
e94e651c
Commit
e94e651c
authored
Sep 26, 2015
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnxhddec: Enable frame threading
Signed-off-by:
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
parent
c49cbecb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
dnxhddec.c
libavcodec/dnxhddec.c
+11
-8
No files found.
libavcodec/dnxhddec.c
View file @
e94e651c
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include "dnxhddata.h"
#include "dnxhddata.h"
#include "idctdsp.h"
#include "idctdsp.h"
#include "internal.h"
#include "internal.h"
#include "thread.h"
typedef
struct
DNXHDContext
{
typedef
struct
DNXHDContext
{
AVCodecContext
*
avctx
;
AVCodecContext
*
avctx
;
...
@@ -427,14 +428,16 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -427,14 +428,16 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data,
const
uint8_t
*
buf
=
avpkt
->
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
int
buf_size
=
avpkt
->
size
;
DNXHDContext
*
ctx
=
avctx
->
priv_data
;
DNXHDContext
*
ctx
=
avctx
->
priv_data
;
AVFrame
*
picture
=
data
;
ThreadFrame
tf
;
int
first_field
=
1
;
int
first_field
=
1
;
int
ret
;
int
ret
;
tf
.
f
=
data
;
ff_dlog
(
avctx
,
"frame size %d
\n
"
,
buf_size
);
ff_dlog
(
avctx
,
"frame size %d
\n
"
,
buf_size
);
decode_coding_unit:
decode_coding_unit:
if
((
ret
=
dnxhd_decode_header
(
ctx
,
picture
,
buf
,
buf_size
,
first_field
))
<
0
)
if
((
ret
=
dnxhd_decode_header
(
ctx
,
tf
.
f
,
buf
,
buf_size
,
first_field
))
<
0
)
return
ret
;
return
ret
;
if
((
avctx
->
width
||
avctx
->
height
)
&&
if
((
avctx
->
width
||
avctx
->
height
)
&&
...
@@ -449,17 +452,17 @@ decode_coding_unit:
...
@@ -449,17 +452,17 @@ decode_coding_unit:
return
ret
;
return
ret
;
if
(
first_field
)
{
if
(
first_field
)
{
if
((
ret
=
ff_
get_buffer
(
avctx
,
picture
,
0
))
<
0
)
{
if
((
ret
=
ff_
thread_get_buffer
(
avctx
,
&
tf
,
0
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
return
ret
;
}
}
picture
->
pict_type
=
AV_PICTURE_TYPE_I
;
tf
.
f
->
pict_type
=
AV_PICTURE_TYPE_I
;
picture
->
key_frame
=
1
;
tf
.
f
->
key_frame
=
1
;
}
}
dnxhd_decode_macroblocks
(
ctx
,
picture
,
buf
+
0x280
,
buf_size
-
0x280
);
dnxhd_decode_macroblocks
(
ctx
,
tf
.
f
,
buf
+
0x280
,
buf_size
-
0x280
);
if
(
first_field
&&
picture
->
interlaced_frame
)
{
if
(
first_field
&&
tf
.
f
->
interlaced_frame
)
{
buf
+=
ctx
->
cid_table
->
coding_unit_size
;
buf
+=
ctx
->
cid_table
->
coding_unit_size
;
buf_size
-=
ctx
->
cid_table
->
coding_unit_size
;
buf_size
-=
ctx
->
cid_table
->
coding_unit_size
;
first_field
=
0
;
first_field
=
0
;
...
@@ -489,5 +492,5 @@ AVCodec ff_dnxhd_decoder = {
...
@@ -489,5 +492,5 @@ AVCodec ff_dnxhd_decoder = {
.
init
=
dnxhd_decode_init
,
.
init
=
dnxhd_decode_init
,
.
close
=
dnxhd_decode_close
,
.
close
=
dnxhd_decode_close
,
.
decode
=
dnxhd_decode_frame
,
.
decode
=
dnxhd_decode_frame
,
.
capabilities
=
AV_CODEC_CAP_DR1
,
.
capabilities
=
AV_CODEC_CAP_DR1
|
AV_CODEC_CAP_FRAME_THREADS
,
};
};
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