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
bd971dda
Commit
bd971dda
authored
Aug 08, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aasc: 8bit support
Closes #1319. Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
8a57ca5c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
aasc.c
libavcodec/aasc.c
+18
-0
No files found.
libavcodec/aasc.c
View file @
bd971dda
...
...
@@ -36,14 +36,29 @@ typedef struct AascContext {
AVCodecContext
*
avctx
;
GetByteContext
gb
;
AVFrame
frame
;
uint32_t
palette
[
AVPALETTE_COUNT
];
int
palette_size
;
}
AascContext
;
static
av_cold
int
aasc_decode_init
(
AVCodecContext
*
avctx
)
{
AascContext
*
s
=
avctx
->
priv_data
;
uint8_t
*
ptr
;
int
i
;
s
->
avctx
=
avctx
;
switch
(
avctx
->
bits_per_coded_sample
)
{
case
8
:
avctx
->
pix_fmt
=
PIX_FMT_PAL8
;
ptr
=
avctx
->
extradata
;
s
->
palette_size
=
FFMIN
(
avctx
->
extradata_size
,
AVPALETTE_SIZE
);
for
(
i
=
0
;
i
<
s
->
palette_size
/
4
;
i
++
)
{
s
->
palette
[
i
]
=
0xFFU
<<
24
|
AV_RL32
(
ptr
);
ptr
+=
4
;
}
break
;
case
16
:
avctx
->
pix_fmt
=
PIX_FMT_RGB555
;
break
;
...
...
@@ -112,6 +127,9 @@ static int aasc_decode_frame(AVCodecContext *avctx,
return
-
1
;
}
if
(
avctx
->
pix_fmt
==
PIX_FMT_PAL8
)
memcpy
(
s
->
frame
.
data
[
1
],
s
->
palette
,
s
->
palette_size
);
*
data_size
=
sizeof
(
AVFrame
);
*
(
AVFrame
*
)
data
=
s
->
frame
;
...
...
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