Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
dab1c4c6
Commit
dab1c4c6
authored
20 years ago
by
Roberto Togni
Browse files
Options
Downloads
Patches
Plain Diff
Paletted cvid support
Originally committed as revision 3263 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
d99fbbf4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/cinepak.c
+17
-12
17 additions, 12 deletions
libavcodec/cinepak.c
with
17 additions
and
12 deletions
libavcodec/cinepak.c
+
17
−
12
View file @
dab1c4c6
...
@@ -35,7 +35,6 @@
...
@@ -35,7 +35,6 @@
#include
"avcodec.h"
#include
"avcodec.h"
#include
"dsputil.h"
#include
"dsputil.h"
#define PALETTE_COUNT 256
typedef
struct
{
typedef
struct
{
uint8_t
y0
,
y1
,
y2
,
y3
;
uint8_t
y0
,
y1
,
y2
,
y3
;
...
@@ -63,7 +62,6 @@ typedef struct CinepakContext {
...
@@ -63,7 +62,6 @@ typedef struct CinepakContext {
int
width
,
height
;
int
width
,
height
;
unsigned
char
palette
[
PALETTE_COUNT
*
4
];
int
palette_video
;
int
palette_video
;
cvid_strip_t
strips
[
MAX_STRIPS
];
cvid_strip_t
strips
[
MAX_STRIPS
];
...
@@ -361,22 +359,20 @@ static int cinepak_decode (CinepakContext *s)
...
@@ -361,22 +359,20 @@ static int cinepak_decode (CinepakContext *s)
static
int
cinepak_decode_init
(
AVCodecContext
*
avctx
)
static
int
cinepak_decode_init
(
AVCodecContext
*
avctx
)
{
{
CinepakContext
*
s
=
(
CinepakContext
*
)
avctx
->
priv_data
;
CinepakContext
*
s
=
(
CinepakContext
*
)
avctx
->
priv_data
;
/*
int i;
unsigned char r, g, b;
unsigned char *raw_palette;
unsigned int *palette32;
*/
s
->
avctx
=
avctx
;
s
->
avctx
=
avctx
;
s
->
width
=
(
avctx
->
width
+
3
)
&
~
3
;
s
->
width
=
(
avctx
->
width
+
3
)
&
~
3
;
s
->
height
=
(
avctx
->
height
+
3
)
&
~
3
;
s
->
height
=
(
avctx
->
height
+
3
)
&
~
3
;
// check for paletted data
// check for paletted data
s
->
palette_video
=
0
;
if
(
avctx
->
palctrl
==
NULL
)
{
s
->
palette_video
=
0
;
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
}
else
{
s
->
palette_video
=
1
;
avctx
->
pix_fmt
=
PIX_FMT_PAL8
;
}
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
avctx
->
has_b_frames
=
0
;
avctx
->
has_b_frames
=
0
;
dsputil_init
(
&
s
->
dsp
,
avctx
);
dsputil_init
(
&
s
->
dsp
,
avctx
);
...
@@ -404,6 +400,15 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
...
@@ -404,6 +400,15 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
cinepak_decode
(
s
);
cinepak_decode
(
s
);
if
(
s
->
palette_video
)
{
memcpy
(
s
->
frame
.
data
[
1
],
avctx
->
palctrl
->
palette
,
AVPALETTE_SIZE
);
if
(
avctx
->
palctrl
->
palette_changed
)
{
s
->
frame
.
palette_has_changed
=
1
;
avctx
->
palctrl
->
palette_changed
=
0
;
}
else
s
->
frame
.
palette_has_changed
=
0
;
}
*
data_size
=
sizeof
(
AVFrame
);
*
data_size
=
sizeof
(
AVFrame
);
*
(
AVFrame
*
)
data
=
s
->
frame
;
*
(
AVFrame
*
)
data
=
s
->
frame
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment