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
db431f7e
Commit
db431f7e
authored
Nov 22, 2011
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: add support for decoding planar RGB images.
parent
6b0768e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
h264.c
libavcodec/h264.c
+16
-7
utils.c
libavcodec/utils.c
+5
-0
No files found.
libavcodec/h264.c
View file @
db431f7e
...
@@ -2727,24 +2727,33 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
...
@@ -2727,24 +2727,33 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
switch
(
h
->
sps
.
bit_depth_luma
)
{
switch
(
h
->
sps
.
bit_depth_luma
)
{
case
9
:
case
9
:
if
(
CHROMA444
)
if
(
CHROMA444
)
{
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV444P9
;
if
(
s
->
avctx
->
colorspace
==
AVCOL_SPC_RGB
)
{
else
if
(
CHROMA422
)
s
->
avctx
->
pix_fmt
=
PIX_FMT_GBRP9
;
}
else
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV444P9
;
}
else
if
(
CHROMA422
)
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV422P9
;
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV422P9
;
else
else
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV420P9
;
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV420P9
;
break
;
break
;
case
10
:
case
10
:
if
(
CHROMA444
)
if
(
CHROMA444
)
{
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV444P10
;
if
(
s
->
avctx
->
colorspace
==
AVCOL_SPC_RGB
)
{
else
if
(
CHROMA422
)
s
->
avctx
->
pix_fmt
=
PIX_FMT_GBRP10
;
}
else
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV444P10
;
}
else
if
(
CHROMA422
)
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV422P10
;
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV422P10
;
else
else
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV420P10
;
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV420P10
;
break
;
break
;
default
:
default
:
if
(
CHROMA444
){
if
(
CHROMA444
){
s
->
avctx
->
pix_fmt
=
s
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
PIX_FMT_YUVJ444P
:
PIX_FMT_YUV444P
;
if
(
s
->
avctx
->
colorspace
==
AVCOL_SPC_RGB
)
{
s
->
avctx
->
pix_fmt
=
PIX_FMT_GBRP
;
}
else
s
->
avctx
->
pix_fmt
=
s
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
PIX_FMT_YUVJ444P
:
PIX_FMT_YUV444P
;
}
else
if
(
CHROMA422
)
{
}
else
if
(
CHROMA422
)
{
s
->
avctx
->
pix_fmt
=
s
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
PIX_FMT_YUVJ422P
:
PIX_FMT_YUV422P
;
s
->
avctx
->
pix_fmt
=
s
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
PIX_FMT_YUVJ422P
:
PIX_FMT_YUV422P
;
}
else
{
}
else
{
...
...
libavcodec/utils.c
View file @
db431f7e
...
@@ -138,6 +138,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
...
@@ -138,6 +138,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
case
PIX_FMT_YUV422P
:
case
PIX_FMT_YUV422P
:
case
PIX_FMT_YUV440P
:
case
PIX_FMT_YUV440P
:
case
PIX_FMT_YUV444P
:
case
PIX_FMT_YUV444P
:
case
PIX_FMT_GBRP
:
case
PIX_FMT_GRAY8
:
case
PIX_FMT_GRAY8
:
case
PIX_FMT_GRAY16BE
:
case
PIX_FMT_GRAY16BE
:
case
PIX_FMT_GRAY16LE
:
case
PIX_FMT_GRAY16LE
:
...
@@ -158,6 +159,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
...
@@ -158,6 +159,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
case
PIX_FMT_YUV444P9BE
:
case
PIX_FMT_YUV444P9BE
:
case
PIX_FMT_YUV444P10LE
:
case
PIX_FMT_YUV444P10LE
:
case
PIX_FMT_YUV444P10BE
:
case
PIX_FMT_YUV444P10BE
:
case
PIX_FMT_GBRP9LE
:
case
PIX_FMT_GBRP9BE
:
case
PIX_FMT_GBRP10LE
:
case
PIX_FMT_GBRP10BE
:
w_align
=
16
;
//FIXME check for non mpeg style codecs and use less alignment
w_align
=
16
;
//FIXME check for non mpeg style codecs and use less alignment
h_align
=
16
;
h_align
=
16
;
if
(
s
->
codec_id
==
CODEC_ID_MPEG2VIDEO
||
s
->
codec_id
==
CODEC_ID_MJPEG
||
s
->
codec_id
==
CODEC_ID_AMV
||
s
->
codec_id
==
CODEC_ID_THP
||
s
->
codec_id
==
CODEC_ID_H264
)
if
(
s
->
codec_id
==
CODEC_ID_MPEG2VIDEO
||
s
->
codec_id
==
CODEC_ID_MJPEG
||
s
->
codec_id
==
CODEC_ID_AMV
||
s
->
codec_id
==
CODEC_ID_THP
||
s
->
codec_id
==
CODEC_ID_H264
)
...
...
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