Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
d7705be9
Commit
d7705be9
authored
May 23, 2014
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideoenc: check color_range
Rework the comparison into something simpler to understand.
parent
27860819
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+16
-6
No files found.
libavcodec/mpegvideo_enc.c
View file @
d7705be9
...
...
@@ -229,7 +229,7 @@ static void MPV_encode_defaults(MpegEncContext *s)
av_cold
int
ff_MPV_encode_init
(
AVCodecContext
*
avctx
)
{
MpegEncContext
*
s
=
avctx
->
priv_data
;
int
i
,
ret
;
int
i
,
ret
,
format_supported
;
MPV_encode_defaults
(
s
);
...
...
@@ -243,11 +243,21 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
}
break
;
case
AV_CODEC_ID_MJPEG
:
if
(
avctx
->
pix_fmt
!=
AV_PIX_FMT_YUVJ420P
&&
avctx
->
pix_fmt
!=
AV_PIX_FMT_YUVJ422P
&&
((
avctx
->
pix_fmt
!=
AV_PIX_FMT_YUV420P
&&
avctx
->
pix_fmt
!=
AV_PIX_FMT_YUV422P
)
||
avctx
->
strict_std_compliance
>
FF_COMPLIANCE_UNOFFICIAL
))
{
format_supported
=
0
;
/* JPEG color space */
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_YUVJ420P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUVJ422P
||
(
avctx
->
color_range
==
AVCOL_RANGE_JPEG
&&
(
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV420P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV422P
)))
format_supported
=
1
;
/* MPEG color space */
else
if
(
avctx
->
strict_std_compliance
<=
FF_COMPLIANCE_UNOFFICIAL
&&
(
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV420P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV422P
))
format_supported
=
1
;
if
(
!
format_supported
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"colorspace not supported in jpeg
\n
"
);
return
-
1
;
}
...
...
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