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
2a2f6b28
Commit
2a2f6b28
authored
Feb 12, 2017
by
Miroslav Slugeň
Committed by
Timo Rothenpieler
Feb 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/cuvid: add drop_second_field as input option
Signed-off-by:
Timo Rothenpieler
<
timo@rothenpieler.org
>
parent
4cb8872e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
cuvid.c
libavcodec/cuvid.c
+7
-3
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/cuvid.c
View file @
2a2f6b28
...
...
@@ -42,6 +42,7 @@ typedef struct CuvidContext
char
*
cu_gpu
;
int
nb_surfaces
;
int
drop_second_field
;
AVBufferRef
*
hwdevice
;
AVBufferRef
*
hwframe
;
...
...
@@ -267,7 +268,7 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
cuinfo
.
bitDepthMinus8
=
format
->
bit_depth_luma_minus8
;
cuinfo
.
DeinterlaceMode
=
ctx
->
deint_mode_current
;
if
(
ctx
->
deint_mode_current
!=
cudaVideoDeinterlaceMode_Weave
)
if
(
ctx
->
deint_mode_current
!=
cudaVideoDeinterlaceMode_Weave
&&
!
ctx
->
drop_second_field
)
avctx
->
framerate
=
av_mul_q
(
avctx
->
framerate
,
(
AVRational
){
2
,
1
});
ctx
->
internal_error
=
CHECK_CU
(
ctx
->
cvdl
->
cuvidCreateDecoder
(
&
ctx
->
cudecoder
,
&
cuinfo
));
...
...
@@ -317,8 +318,10 @@ static int CUDAAPI cuvid_handle_picture_display(void *opaque, CUVIDPARSERDISPINF
}
else
{
parsed_frame
.
is_deinterlacing
=
1
;
av_fifo_generic_write
(
ctx
->
frame_queue
,
&
parsed_frame
,
sizeof
(
CuvidParsedFrame
),
NULL
);
parsed_frame
.
second_field
=
1
;
av_fifo_generic_write
(
ctx
->
frame_queue
,
&
parsed_frame
,
sizeof
(
CuvidParsedFrame
),
NULL
);
if
(
!
ctx
->
drop_second_field
)
{
parsed_frame
.
second_field
=
1
;
av_fifo_generic_write
(
ctx
->
frame_queue
,
&
parsed_frame
,
sizeof
(
CuvidParsedFrame
),
NULL
);
}
}
return
1
;
...
...
@@ -949,6 +952,7 @@ static const AVOption options[] = {
{
"adaptive"
,
"Adaptive deinterlacing"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
cudaVideoDeinterlaceMode_Adaptive
},
0
,
0
,
VD
,
"deint"
},
{
"gpu"
,
"GPU to be used for decoding"
,
OFFSET
(
cu_gpu
),
AV_OPT_TYPE_STRING
,
{
.
str
=
NULL
},
0
,
0
,
VD
},
{
"surfaces"
,
"Maximum surfaces to be used for decoding"
,
OFFSET
(
nb_surfaces
),
AV_OPT_TYPE_INT
,
{
.
i64
=
25
},
0
,
INT_MAX
,
VD
},
{
"drop_second_field"
,
"Drop second field when deinterlacing"
,
OFFSET
(
drop_second_field
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
VD
},
{
NULL
}
};
...
...
libavcodec/version.h
View file @
2a2f6b28
...
...
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 80
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
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