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
23824b96
Commit
23824b96
authored
Oct 07, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/dpx: support for 8 and 16 bit luma only files
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
e745dc2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
dpx.c
libavcodec/dpx.c
+13
-0
dpxenc.c
libavcodec/dpxenc.c
+7
-0
No files found.
libavcodec/dpx.c
View file @
23824b96
...
...
@@ -149,6 +149,9 @@ static int decode_frame(AVCodecContext *avctx,
avctx
->
sample_aspect_ratio
=
(
AVRational
){
0
,
1
};
switch
(
descriptor
)
{
case
6
:
// Y
elements
=
1
;
break
;
case
51
:
// RGBA
elements
=
4
;
break
;
...
...
@@ -191,6 +194,10 @@ static int decode_frame(AVCodecContext *avctx,
}
switch
(
1000
*
descriptor
+
10
*
bits_per_color
+
endian
)
{
case
6081
:
case
6080
:
avctx
->
pix_fmt
=
AV_PIX_FMT_GRAY8
;
break
;
case
50081
:
case
50080
:
avctx
->
pix_fmt
=
AV_PIX_FMT_RGB24
;
...
...
@@ -211,6 +218,12 @@ static int decode_frame(AVCodecContext *avctx,
case
51121
:
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRP12
;
break
;
case
6161
:
avctx
->
pix_fmt
=
AV_PIX_FMT_GRAY16BE
;
break
;
case
6160
:
avctx
->
pix_fmt
=
AV_PIX_FMT_GRAY16LE
;
break
;
case
50161
:
avctx
->
pix_fmt
=
AV_PIX_FMT_RGB48BE
;
break
;
...
...
libavcodec/dpxenc.c
View file @
23824b96
...
...
@@ -43,6 +43,11 @@ static av_cold int encode_init(AVCodecContext *avctx)
s
->
planar
=
!!
(
desc
->
flags
&
AV_PIX_FMT_FLAG_PLANAR
);
switch
(
avctx
->
pix_fmt
)
{
case
AV_PIX_FMT_GRAY16BE
:
case
AV_PIX_FMT_GRAY16LE
:
case
AV_PIX_FMT_GRAY8
:
s
->
descriptor
=
6
;
break
;
case
AV_PIX_FMT_GBRP10BE
:
case
AV_PIX_FMT_GBRP10LE
:
case
AV_PIX_FMT_GBRP12BE
:
...
...
@@ -242,7 +247,9 @@ AVCodec ff_dpx_encoder = {
.
init
=
encode_init
,
.
encode2
=
encode_frame
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_RGB24
,
AV_PIX_FMT_RGBA
,
AV_PIX_FMT_GRAY16LE
,
AV_PIX_FMT_GRAY16BE
,
AV_PIX_FMT_RGB48LE
,
AV_PIX_FMT_RGB48BE
,
AV_PIX_FMT_RGBA64LE
,
AV_PIX_FMT_RGBA64BE
,
AV_PIX_FMT_GBRP10LE
,
AV_PIX_FMT_GBRP10BE
,
...
...
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