Go to the documentation of this file.
85 n = (chunk_id & 0x04) ? 4 : 6;
90 for (
i=0;
i < 256;
i++) {
91 if ((chunk_id & 0x01) && !(
mask >>= 1)) {
100 if (!(chunk_id & 0x01) || (
flag &
mask)) {
103 if ((
data + n) > eod)
106 for (k = 0; k < 4; ++k) {
108 for (kk = 0; kk < 3; ++kk)
113 u = *(int8_t *)
data++;
114 v = *(int8_t *)
data++;
118 g = *p++ - (
u/2) - v;
121 *p++ = av_clip_uint8(
r);
122 *p++ = av_clip_uint8(
g);
123 *p++ = av_clip_uint8(
b);
137 uint8_t *cb0, *cb1, *cb2, *cb3;
139 char *ip0, *ip1, *ip2, *ip3;
144 for (y=strip->
y1; y < strip->y2; y+=4) {
147 ip0 = ip1 = ip2 = ip3 =
s->frame->data[0] +
148 (
s->palette_video?strip->
x1:strip->
x1*3) + (y *
s->frame->linesize[0]);
149 if(
s->avctx->height - y > 1) {
150 ip1 = ip0 +
s->frame->linesize[0];
151 if(
s->avctx->height - y > 2) {
152 ip2 = ip1 +
s->frame->linesize[0];
153 if(
s->avctx->height - y > 3) {
154 ip3 = ip2 +
s->frame->linesize[0];
163 for (
x=strip->
x1; x < strip->x2;
x+=4) {
164 if ((chunk_id & 0x01) && !(
mask >>= 1)) {
165 if ((
data + 4) > eod)
173 if (!(chunk_id & 0x01) || (
flag &
mask)) {
174 if (!(chunk_id & 0x02) && !(
mask >>= 1)) {
175 if ((
data + 4) > eod)
183 if ((chunk_id & 0x02) || (~
flag &
mask)) {
189 if (
s->palette_video) {
190 ip3[0] = ip3[1] = ip2[0] = ip2[1] = p[6];
191 ip3[2] = ip3[3] = ip2[2] = ip2[3] = p[9];
192 ip1[0] = ip1[1] = ip0[0] = ip0[1] = p[0];
193 ip1[2] = ip1[3] = ip0[2] = ip0[3] = p[3];
196 memcpy(ip3 + 0, p, 3); memcpy(ip3 + 3, p, 3);
197 memcpy(ip2 + 0, p, 3); memcpy(ip2 + 3, p, 3);
199 memcpy(ip3 + 6, p, 3); memcpy(ip3 + 9, p, 3);
200 memcpy(ip2 + 6, p, 3); memcpy(ip2 + 9, p, 3);
202 memcpy(ip1 + 0, p, 3); memcpy(ip1 + 3, p, 3);
203 memcpy(ip0 + 0, p, 3); memcpy(ip0 + 3, p, 3);
205 memcpy(ip1 + 6, p, 3); memcpy(ip1 + 9, p, 3);
206 memcpy(ip0 + 6, p, 3); memcpy(ip0 + 9, p, 3);
210 if ((
data + 4) > eod)
217 if (
s->palette_video) {
240 memcpy(ip3 + 0, cb2 + 6, 6);
241 memcpy(ip3 + 6, cb3 + 6, 6);
242 memcpy(ip2 + 0, cb2 + 0, 6);
243 memcpy(ip2 + 6, cb3 + 0, 6);
244 memcpy(ip1 + 0, cb0 + 6, 6);
245 memcpy(ip1 + 6, cb1 + 6, 6);
246 memcpy(ip0 + 0, cb0 + 0, 6);
247 memcpy(ip0 + 6, cb1 + 0, 6);
253 if (
s->palette_video) {
257 ip0 += 12; ip1 += 12;
258 ip2 += 12; ip3 += 12;
270 int chunk_id, chunk_size;
273 if (strip->
x2 >
s->width ||
274 strip->
y2 >
s->height ||
275 strip->
x1 >= strip->
x2 || strip->
y1 >= strip->
y2)
278 while ((
data + 4) <= eod) {
285 chunk_size = ((
data + chunk_size) > eod) ? (eod -
data) : chunk_size;
321 int encoded_buf_size;
324 encoded_buf_size =
AV_RB24(&
s->data[1]);
326 if (
s->size < encoded_buf_size * (int64_t)(100 -
s->avctx->discard_damaged_percentage) / 100)
330 if (
s->sega_film_skip_bytes == -1) {
331 if (!encoded_buf_size) {
335 if (encoded_buf_size !=
s->size && (
s->size % encoded_buf_size) != 0) {
343 (
s->data[10] == 0xFE) &&
344 (
s->data[11] == 0x00) &&
345 (
s->data[12] == 0x00) &&
346 (
s->data[13] == 0x06) &&
347 (
s->data[14] == 0x00) &&
348 (
s->data[15] == 0x00))
349 s->sega_film_skip_bytes = 6;
351 s->sega_film_skip_bytes = 2;
353 s->sega_film_skip_bytes = 0;
356 if (
s->size < 10 +
s->sega_film_skip_bytes + num_strips * 12)
360 const uint8_t *
data =
s->data + 10 +
s->sega_film_skip_bytes;
362 if (strip_size < 12 || strip_size > encoded_buf_size)
371 const uint8_t *eod = (
s->data +
s->size);
372 int i,
result, strip_size, frame_flags, num_strips;
375 frame_flags =
s->data[0];
378 s->data += 10 +
s->sega_film_skip_bytes;
382 s->frame->key_frame = 0;
384 for (
i=0;
i < num_strips;
i++) {
385 if ((
s->data + 12) > eod)
388 s->strips[
i].id =
s->data[0];
390 if (!(
s->strips[
i].y1 =
AV_RB16 (&
s->data[4])))
391 s->strips[
i].y2 = (
s->strips[
i].y1 = y0) +
AV_RB16 (&
s->data[8]);
397 if (
s->strips[
i].id == 0x10)
398 s->frame->key_frame = 1;
400 strip_size =
AV_RB24 (&
s->data[1]) - 12;
404 strip_size = ((
s->data + strip_size) > eod) ? (eod -
s->data) : strip_size;
406 if ((
i > 0) && !(frame_flags & 0x01)) {
407 memcpy (
s->strips[
i].v4_codebook,
s->strips[
i-1].v4_codebook,
408 sizeof(
s->strips[
i].v4_codebook));
409 memcpy (
s->strips[
i].v1_codebook,
s->strips[
i-1].v1_codebook,
410 sizeof(
s->strips[
i].v1_codebook));
418 s->data += strip_size;
419 y0 =
s->strips[
i].y2;
429 s->width = (avctx->
width + 3) & ~3;
430 s->height = (avctx->
height + 3) & ~3;
432 s->sega_film_skip_bytes = -1;
436 s->palette_video = 0;
439 s->palette_video = 1;
451 void *
data,
int *got_frame,
455 int ret = 0, buf_size = avpkt->
size;
479 if (
s->palette_video) {
483 s->frame->palette_has_changed = 1;
494 if (
s->palette_video)
static av_cold int init(AVCodecContext *avctx)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVCodec ff_cinepak_decoder
#define u(width, name, range_min, range_max)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
uint8_t cvid_codebook[12]
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
static int cinepak_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static int cinepak_predecode_check(CinepakContext *s)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const uint16_t mask[17]
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static int cinepak_decode_strip(CinepakContext *s, cvid_strip *strip, const uint8_t *data, int size)
cvid_codebook v1_codebook[256]
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
and forward the result(frame or status change) to the corresponding input. If nothing is possible
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
cvid_codebook v4_codebook[256]
static void cinepak_decode_codebook(cvid_codebook *codebook, int chunk_id, int size, const uint8_t *data)
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
static av_cold int cinepak_decode_init(AVCodecContext *avctx)
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#define i(width, name, range_min, range_max)
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
static int cinepak_decode_vectors(CinepakContext *s, cvid_strip *strip, int chunk_id, int size, const uint8_t *data)
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
main external API structure.
static av_cold int cinepak_decode_end(AVCodecContext *avctx)
#define avpriv_request_sample(...)
This structure stores compressed data.
cvid_strip strips[MAX_STRIPS]
int width
picture width / height.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int cinepak_decode(CinepakContext *s)
const unsigned char * data