libavcodec/yop.c File Reference

Psygnosis YOP decoder. More...

#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "get_bits.h"

Go to the source code of this file.

Data Structures

struct  YopDecContext

Functions

static av_cold int yop_decode_init (AVCodecContext *avctx)
static av_cold int yop_decode_close (AVCodecContext *avctx)
static void yop_paint_block (YopDecContext *s, int tag)
 Paints a macroblock using the pattern in paint_lut.
static int yop_copy_previous_block (YopDecContext *s, int copy_tag)
 Copies a previously painted macroblock to the current_block.
static uint8_t yop_get_next_nibble (YopDecContext *s)
 Returns the next nibble in sequence, consuming a new byte on the input only if necessary.
static void yop_next_macroblock (YopDecContext *s)
 Takes s->dstptr to the next macroblock in sequence.
static int yop_decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)

Variables

static const uint8_t paint_lut [15][4]
 Lookup table for painting macroblocks.
static const int8_t motion_vector [16][2]
 Lookup table for copying macroblocks.
AVCodec yop_decoder


Detailed Description

Psygnosis YOP decoder.

Copyright (C) 2010 Mohamed Naufal Basheer <naufal11@gmail.com> derived from the code by Copyright (C) 2009 Thomas P. Higdon <thomas.p.higdon@gmail.com>

This file is part of FFmpeg.

FFmpeg is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

FFmpeg is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with FFmpeg; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file yop.c.


Function Documentation

static int yop_copy_previous_block ( YopDecContext s,
int  copy_tag 
) [static]

Copies a previously painted macroblock to the current_block.

Parameters:
copy_tag the tag that was in the nibble

Definition at line 141 of file yop.c.

Referenced by yop_decode_frame().

static av_cold int yop_decode_close ( AVCodecContext avctx  )  [static]

Definition at line 113 of file yop.c.

static int yop_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
AVPacket avpkt 
) [static]

Definition at line 195 of file yop.c.

static av_cold int yop_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 81 of file yop.c.

static uint8_t yop_get_next_nibble ( YopDecContext s  )  [static]

Returns the next nibble in sequence, consuming a new byte on the input only if necessary.

Definition at line 166 of file yop.c.

Referenced by yop_decode_frame().

static void yop_next_macroblock ( YopDecContext s  )  [static]

Takes s->dstptr to the next macroblock in sequence.

Definition at line 183 of file yop.c.

Referenced by yop_decode_frame().

static void yop_paint_block ( YopDecContext s,
int  tag 
) [static]

Paints a macroblock using the pattern in paint_lut.

Parameters:
s codec context
tag the tag that was in the nibble

Definition at line 126 of file yop.c.

Referenced by yop_decode_frame().


Variable Documentation

const int8_t motion_vector[16][2] [static]

Initial value:

    {{-4, -4}, {-2, -4},
     { 0, -4}, { 2, -4},
     {-4, -2}, {-4,  0},
     {-3, -3}, {-1, -3},
     { 1, -3}, { 3, -3},
     {-3, -1}, {-2, -2},
     { 0, -2}, { 2, -2},
     { 4, -2}, {-2,  0},
    }
Lookup table for copying macroblocks.

Each entry contains the respective x and y pixel offset for the copy source.

Definition at line 70 of file yop.c.

Referenced by yop_copy_previous_block().

const uint8_t paint_lut[15][4] [static]

Initial value:

    {{1, 2, 3, 4}, {1, 2, 0, 3},
     {1, 2, 1, 3}, {1, 2, 2, 3},
     {1, 0, 2, 3}, {1, 0, 0, 2},
     {1, 0, 1, 2}, {1, 1, 2, 3},
     {0, 1, 2, 3}, {0, 1, 0, 2},
     {1, 1, 0, 2}, {0, 1, 1, 2},
     {0, 0, 1, 2}, {0, 0, 0, 1},
     {1, 1, 1, 2},
    }
Lookup table for painting macroblocks.

Bytes 0-2 of each entry contain the macroblock positions to be painted (taken as (0, B0, B1, B2)). Byte 3 contains the number of bytes consumed on the input, equal to max(bytes 0-2) + 1.

Definition at line 55 of file yop.c.

Referenced by yop_paint_block().

Initial value:

 {
    "yop",
    AVMEDIA_TYPE_VIDEO,
    CODEC_ID_YOP,
    sizeof(YopDecContext),
    yop_decode_init,
    NULL,
    yop_decode_close,
    yop_decode_frame,
    .long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"),
}

Definition at line 264 of file yop.c.


Generated on Fri Oct 26 02:36:54 2012 for FFmpeg by  doxygen 1.5.8