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
2f1d6d45
Commit
2f1d6d45
authored
Oct 30, 2015
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/cdg: Add transparency support.
parent
b7fb7c45
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
222 additions
and
214 deletions
+222
-214
cdgraphics.c
libavcodec/cdgraphics.c
+8
-0
version.h
libavcodec/version.h
+1
-1
video.mak
tests/fate/video.mak
+1
-1
cdgraphics
tests/ref/fate/cdgraphics
+212
-212
No files found.
libavcodec/cdgraphics.c
View file @
2f1d6d45
...
...
@@ -49,6 +49,7 @@
#define CDG_INST_TILE_BLOCK 6
#define CDG_INST_SCROLL_PRESET 20
#define CDG_INST_SCROLL_COPY 24
#define CDG_INST_TRANSPARENT_COL 28
#define CDG_INST_LOAD_PAL_LO 30
#define CDG_INST_LOAD_PAL_HIGH 31
#define CDG_INST_TILE_BLOCK_XOR 38
...
...
@@ -67,6 +68,7 @@ typedef struct CDGraphicsContext {
AVFrame
*
frame
;
int
hscroll
;
int
vscroll
;
int
transparency
;
}
CDGraphicsContext
;
static
av_cold
int
cdg_decode_init
(
AVCodecContext
*
avctx
)
...
...
@@ -76,6 +78,7 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx)
cc
->
frame
=
av_frame_alloc
();
if
(
!
cc
->
frame
)
return
AVERROR
(
ENOMEM
);
cc
->
transparency
=
-
1
;
avctx
->
width
=
CDG_FULL_WIDTH
;
avctx
->
height
=
CDG_FULL_HEIGHT
;
...
...
@@ -120,6 +123,8 @@ static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low)
g
=
((
color
>>
4
)
&
0x000F
)
*
17
;
b
=
((
color
)
&
0x000F
)
*
17
;
palette
[
i
+
array_offset
]
=
0xFFU
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
if
(
cc
->
transparency
>=
0
)
palette
[
cc
->
transparency
]
&=
0xFFFFFF
;
}
cc
->
frame
->
palette_has_changed
=
1
;
}
...
...
@@ -341,6 +346,9 @@ static int cdg_decode_frame(AVCodecContext *avctx,
if
(
ret
<
0
)
return
ret
;
break
;
case
CDG_INST_TRANSPARENT_COL
:
cc
->
transparency
=
cdg_data
[
0
]
&
0xF
;
break
;
default:
break
;
}
...
...
libavcodec/version.h
View file @
2f1d6d45
...
...
@@ -30,7 +30,7 @@
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 13
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
tests/fate/video.mak
View file @
2f1d6d45
...
...
@@ -85,7 +85,7 @@ FATE_VIDEO-$(call DEMDEC, MPEGPS, CAVS) += fate-cavs
fate-cavs: CMD = framecrc -i $(TARGET_SAMPLES)/cavs/cavs.mpg -an
FATE_VIDEO-$(call DEMDEC, CDG, CDGRAPHICS) += fate-cdgraphics
fate-cdgraphics: CMD = framecrc -i $(TARGET_SAMPLES)/cdgraphics/BrotherJohn.cdg -pix_fmt rgb
24
-t 1
fate-cdgraphics: CMD = framecrc -i $(TARGET_SAMPLES)/cdgraphics/BrotherJohn.cdg -pix_fmt rgb
a
-t 1
FATE_VIDEO-$(call DEMDEC, AVI, CLJR) += fate-cljr
fate-cljr: CMD = framecrc -i $(TARGET_SAMPLES)/cljr/testcljr-partial.avi
...
...
tests/ref/fate/cdgraphics
View file @
2f1d6d45
This diff is collapsed.
Click to expand it.
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