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
b183abfb
Commit
b183abfb
authored
Jul 22, 2016
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vpx: Support color range
The range field has been introduced in version 1.6.0
parent
ad71d327
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
libvpxdec.c
libavcodec/libvpxdec.c
+10
-0
libvpxenc.c
libavcodec/libvpxenc.c
+10
-0
No files found.
libavcodec/libvpxdec.c
View file @
b183abfb
...
...
@@ -99,6 +99,16 @@ static int vp8_decode(AVCodecContext *avctx,
return
ret
;
av_image_copy
(
picture
->
data
,
picture
->
linesize
,
img
->
planes
,
img
->
stride
,
avctx
->
pix_fmt
,
img
->
d_w
,
img
->
d_h
);
#if VPX_IMAGE_ABI_VERSION >= 4
switch
(
img
->
range
)
{
case
VPX_CR_STUDIO_RANGE
:
picture
->
color_range
=
AVCOL_RANGE_MPEG
;
break
;
case
VPX_CR_FULL_RANGE
:
picture
->
color_range
=
AVCOL_RANGE_JPEG
;
break
;
}
#endif
*
got_frame
=
1
;
}
return
avpkt
->
size
;
...
...
libavcodec/libvpxenc.c
View file @
b183abfb
...
...
@@ -552,6 +552,16 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket *pkt,
rawimg
->
stride
[
VPX_PLANE_U
]
=
frame
->
linesize
[
1
];
rawimg
->
stride
[
VPX_PLANE_V
]
=
frame
->
linesize
[
2
];
timestamp
=
frame
->
pts
;
#if VPX_IMAGE_ABI_VERSION >= 4
switch
(
frame
->
color_range
)
{
case
AVCOL_RANGE_MPEG
:
rawimg
->
range
=
VPX_CR_STUDIO_RANGE
;
break
;
case
AVCOL_RANGE_JPEG
:
rawimg
->
range
=
VPX_CR_FULL_RANGE
;
break
;
}
#endif
if
(
frame
->
pict_type
==
AV_PICTURE_TYPE_I
)
flags
|=
VPX_EFLAG_FORCE_KF
;
}
...
...
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