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
698fdc85
Commit
698fdc85
authored
Mar 02, 2016
by
Mats Peterson
Committed by
Michael Niedermayer
Mar 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/riffenc: Handle palette for non-raw codecs
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
0443b2cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
riffenc.c
libavformat/riffenc.c
+11
-9
No files found.
libavformat/riffenc.c
View file @
698fdc85
...
...
@@ -209,12 +209,17 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
int
keep_height
=
enc
->
extradata_size
>=
9
&&
!
memcmp
(
enc
->
extradata
+
enc
->
extradata_size
-
9
,
"BottomUp"
,
9
);
int
extradata_size
=
enc
->
extradata_size
-
9
*
keep_height
;
int
raw_pal_avi
;
enum
AVPixelFormat
pix_fmt
=
enc
->
pix_fmt
;
int
pal_avi
;
raw_pal_avi
=
!
for_asf
&&
enc
->
codec_id
==
AV_CODEC_ID_RAWVIDEO
&&
!
enc
->
codec_tag
&&
enc
->
bits_per_coded_sample
>=
1
&&
enc
->
bits_per_coded_sample
<=
8
;
if
(
!
enc
->
extradata_size
&&
raw_pal_avi
)
if
(
pix_fmt
==
AV_PIX_FMT_NONE
&&
enc
->
bits_per_coded_sample
==
1
)
pix_fmt
=
AV_PIX_FMT_MONOWHITE
;
pal_avi
=
!
for_asf
&&
(
pix_fmt
==
AV_PIX_FMT_PAL8
||
pix_fmt
==
AV_PIX_FMT_MONOWHITE
||
pix_fmt
==
AV_PIX_FMT_MONOBLACK
);
if
(
!
enc
->
extradata_size
&&
pal_avi
)
extradata_size
=
4
*
(
1
<<
enc
->
bits_per_coded_sample
);
/* size */
...
...
@@ -239,11 +244,8 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
avio_write
(
pb
,
enc
->
extradata
,
extradata_size
);
if
(
!
for_asf
&&
extradata_size
&
1
)
avio_w8
(
pb
,
0
);
}
else
if
(
raw_
pal_avi
)
{
}
else
if
(
pal_avi
)
{
int
i
;
enum
AVPixelFormat
pix_fmt
=
enc
->
pix_fmt
;
if
(
pix_fmt
==
AV_PIX_FMT_NONE
&&
enc
->
bits_per_coded_sample
==
1
)
pix_fmt
=
AV_PIX_FMT_MONOWHITE
;
for
(
i
=
0
;
i
<
1
<<
enc
->
bits_per_coded_sample
;
i
++
)
{
/* Initialize 1 bpp palette to black & white */
if
(
i
==
0
&&
pix_fmt
==
AV_PIX_FMT_MONOWHITE
)
...
...
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