Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
84e5159e
Commit
84e5159e
authored
Jan 10, 2012
by
Paul B Mahol
Committed by
Ronald S. Bultje
Jan 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bmpenc: support for PIX_FMT_RGB444
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
b14fa557
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
bmpenc.c
libavcodec/bmpenc.c
+8
-3
No files found.
libavcodec/bmpenc.c
View file @
84e5159e
...
...
@@ -27,6 +27,7 @@
static
const
uint32_t
monoblack_pal
[]
=
{
0x000000
,
0xFFFFFF
};
static
const
uint32_t
rgb565_masks
[]
=
{
0xF800
,
0x07E0
,
0x001F
};
static
const
uint32_t
rgb444_masks
[]
=
{
0x0F00
,
0x00F0
,
0x000F
};
static
av_cold
int
bmp_encode_init
(
AVCodecContext
*
avctx
){
BMPContext
*
s
=
avctx
->
priv_data
;
...
...
@@ -39,9 +40,8 @@ static av_cold int bmp_encode_init(AVCodecContext *avctx){
avctx
->
bits_per_coded_sample
=
24
;
break
;
case
PIX_FMT_RGB555
:
avctx
->
bits_per_coded_sample
=
16
;
break
;
case
PIX_FMT_RGB565
:
case
PIX_FMT_RGB444
:
avctx
->
bits_per_coded_sample
=
16
;
break
;
case
PIX_FMT_RGB8
:
...
...
@@ -77,6 +77,11 @@ static int bmp_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_s
p
->
pict_type
=
AV_PICTURE_TYPE_I
;
p
->
key_frame
=
1
;
switch
(
avctx
->
pix_fmt
)
{
case
PIX_FMT_RGB444
:
compression
=
BMP_BITFIELDS
;
pal
=
rgb444_masks
;
// abuse pal to hold color masks
pal_entries
=
3
;
break
;
case
PIX_FMT_RGB565
:
compression
=
BMP_BITFIELDS
;
pal
=
rgb565_masks
;
// abuse pal to hold color masks
...
...
@@ -158,7 +163,7 @@ AVCodec ff_bmp_encoder = {
.
encode
=
bmp_encode_frame
,
.
pix_fmts
=
(
const
enum
PixelFormat
[]){
PIX_FMT_BGR24
,
PIX_FMT_RGB555
,
PIX_FMT_RGB565
,
PIX_FMT_RGB555
,
PIX_FMT_RGB
444
,
PIX_FMT_RGB
565
,
PIX_FMT_RGB8
,
PIX_FMT_BGR8
,
PIX_FMT_RGB4_BYTE
,
PIX_FMT_BGR4_BYTE
,
PIX_FMT_GRAY8
,
PIX_FMT_PAL8
,
PIX_FMT_MONOBLACK
,
PIX_FMT_NONE
},
...
...
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