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
c7caed88
Commit
c7caed88
authored
Sep 25, 2014
by
Rémi Denis-Courmont
Committed by
Luca Barbato
Sep 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: Always invoke the get_format() callback
Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
f13f5a7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
h264.c
libavcodec/h264.c
+31
-20
No files found.
libavcodec/h264.c
View file @
c7caed88
...
@@ -3083,45 +3083,54 @@ static int h264_set_parameter_from_sps(H264Context *h)
...
@@ -3083,45 +3083,54 @@ static int h264_set_parameter_from_sps(H264Context *h)
static
enum
AVPixelFormat
get_pixel_format
(
H264Context
*
h
)
static
enum
AVPixelFormat
get_pixel_format
(
H264Context
*
h
)
{
{
enum
AVPixelFormat
pix_fmts
[
2
];
const
enum
AVPixelFormat
*
choices
=
pix_fmts
;
pix_fmts
[
1
]
=
AV_PIX_FMT_NONE
;
switch
(
h
->
sps
.
bit_depth_luma
)
{
switch
(
h
->
sps
.
bit_depth_luma
)
{
case
9
:
case
9
:
if
(
CHROMA444
(
h
))
{
if
(
CHROMA444
(
h
))
{
if
(
h
->
avctx
->
colorspace
==
AVCOL_SPC_RGB
)
{
if
(
h
->
avctx
->
colorspace
==
AVCOL_SPC_RGB
)
{
return
AV_PIX_FMT_GBRP9
;
pix_fmts
[
0
]
=
AV_PIX_FMT_GBRP9
;
}
else
}
else
return
AV_PIX_FMT_YUV444P9
;
pix_fmts
[
0
]
=
AV_PIX_FMT_YUV444P9
;
}
else
if
(
CHROMA422
(
h
))
}
else
if
(
CHROMA422
(
h
))
return
AV_PIX_FMT_YUV422P9
;
pix_fmts
[
0
]
=
AV_PIX_FMT_YUV422P9
;
else
else
return
AV_PIX_FMT_YUV420P9
;
pix_fmts
[
0
]
=
AV_PIX_FMT_YUV420P9
;
break
;
break
;
case
10
:
case
10
:
if
(
CHROMA444
(
h
))
{
if
(
CHROMA444
(
h
))
{
if
(
h
->
avctx
->
colorspace
==
AVCOL_SPC_RGB
)
{
if
(
h
->
avctx
->
colorspace
==
AVCOL_SPC_RGB
)
{
return
AV_PIX_FMT_GBRP10
;
pix_fmts
[
0
]
=
AV_PIX_FMT_GBRP10
;
}
else
}
else
return
AV_PIX_FMT_YUV444P10
;
pix_fmts
[
0
]
=
AV_PIX_FMT_YUV444P10
;
}
else
if
(
CHROMA422
(
h
))
}
else
if
(
CHROMA422
(
h
))
return
AV_PIX_FMT_YUV422P10
;
pix_fmts
[
0
]
=
AV_PIX_FMT_YUV422P10
;
else
else
return
AV_PIX_FMT_YUV420P10
;
pix_fmts
[
0
]
=
AV_PIX_FMT_YUV420P10
;
break
;
break
;
case
8
:
case
8
:
if
(
CHROMA444
(
h
))
{
if
(
CHROMA444
(
h
))
{
if
(
h
->
avctx
->
colorspace
==
AVCOL_SPC_RGB
)
{
if
(
h
->
avctx
->
colorspace
==
AVCOL_SPC_RGB
)
return
AV_PIX_FMT_GBRP
;
pix_fmts
[
0
]
=
AV_PIX_FMT_GBRP
;
}
else
else
if
(
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
)
return
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
AV_PIX_FMT_YUVJ444P
pix_fmts
[
0
]
=
AV_PIX_FMT_YUVJ444P
;
:
AV_PIX_FMT_YUV444P
;
else
pix_fmts
[
0
]
=
AV_PIX_FMT_YUV444P
;
}
else
if
(
CHROMA422
(
h
))
{
}
else
if
(
CHROMA422
(
h
))
{
return
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
AV_PIX_FMT_YUVJ422P
if
(
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
)
:
AV_PIX_FMT_YUV422P
;
pix_fmts
[
0
]
=
AV_PIX_FMT_YUVJ422P
;
else
pix_fmts
[
0
]
=
AV_PIX_FMT_YUV422P
;
}
else
{
}
else
{
return
h
->
avctx
->
get_format
(
h
->
avctx
,
h
->
avctx
->
codec
->
pix_fmts
?
if
(
h
->
avctx
->
codec
->
pix_fmts
)
h
->
avctx
->
codec
->
pix_fmts
:
choices
=
h
->
avctx
->
codec
->
pix_fmts
;
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
else
if
(
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
)
h264_hwaccel_pixfmt_list_jpeg_420
:
choices
=
h264_hwaccel_pixfmt_list_jpeg_420
;
h264_hwaccel_pixfmt_list_420
);
else
choices
=
h264_hwaccel_pixfmt_list_420
;
}
}
break
;
break
;
default:
default:
...
@@ -3129,6 +3138,8 @@ static enum AVPixelFormat get_pixel_format(H264Context *h)
...
@@ -3129,6 +3138,8 @@ static enum AVPixelFormat get_pixel_format(H264Context *h)
"Unsupported bit depth %d
\n
"
,
h
->
sps
.
bit_depth_luma
);
"Unsupported bit depth %d
\n
"
,
h
->
sps
.
bit_depth_luma
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
return
h
->
avctx
->
get_format
(
h
->
avctx
,
choices
);
}
}
/* export coded and cropped frame dimensions to AVCodecContext */
/* export coded and cropped frame dimensions to AVCodecContext */
...
...
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