#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "internal.h"
#include "dsputil.h"
#include "get_bits.h"
#include "vp3data.h"
#include "vp3dsp.h"
#include "xiph.h"
#include "thread.h"
Go to the source code of this file.
Data Structures | |
struct | Vp3Fragment |
struct | Vp3DecodeContext |
Defines | |
#define | FRAGMENT_PIXELS 8 |
#define | SB_NOT_CODED 0 |
#define | SB_PARTIALLY_CODED 1 |
#define | SB_FULLY_CODED 2 |
#define | MAXIMUM_LONG_BIT_RUN 4129 |
#define | MODE_INTER_NO_MV 0 |
#define | MODE_INTRA 1 |
#define | MODE_INTER_PLUS_MV 2 |
#define | MODE_INTER_LAST_MV 3 |
#define | MODE_INTER_PRIOR_LAST 4 |
#define | MODE_USING_GOLDEN 5 |
#define | MODE_GOLDEN_MV 6 |
#define | MODE_INTER_FOURMV 7 |
#define | CODING_MODE_COUNT 8 |
#define | MODE_COPY 8 |
#define | MIN_DEQUANT_VAL 2 |
#define | TOKEN_EOB(eob_run) ((eob_run) << 2) |
#define | TOKEN_ZERO_RUN(coeff, zero_run) (((coeff) << 9) + ((zero_run) << 2) + 1) |
#define | TOKEN_COEFF(coeff) (((coeff) << 2) + 2) |
#define | BLOCK_X (2*mb_x + (k&1)) |
#define | BLOCK_Y (2*mb_y + (k>>1)) |
#define | SET_CHROMA_MODES |
#define | COMPATIBLE_FRAME(x) (compatible_frame[s->all_fragments[x].coding_method] == current_frame_type) |
#define | DC_COEFF(u) s->all_fragments[u].dc |
#define | PUL 8 |
#define | PU 4 |
#define | PUR 2 |
#define | PL 1 |
#define | copy_fields(to, from, start_field, end_field) memcpy(&to->start_field, &from->start_field, (char*)&to->end_field - (char*)&to->start_field) |
Functions | |
static void | vp3_decode_flush (AVCodecContext *avctx) |
static av_cold int | vp3_decode_end (AVCodecContext *avctx) |
static int | init_block_mapping (Vp3DecodeContext *s) |
static void | init_dequantizer (Vp3DecodeContext *s, int qpi) |
static void | init_loop_filter (Vp3DecodeContext *s) |
static int | unpack_superblocks (Vp3DecodeContext *s, GetBitContext *gb) |
static int | unpack_modes (Vp3DecodeContext *s, GetBitContext *gb) |
static int | unpack_vectors (Vp3DecodeContext *s, GetBitContext *gb) |
static int | unpack_block_qpis (Vp3DecodeContext *s, GetBitContext *gb) |
static int | unpack_vlcs (Vp3DecodeContext *s, GetBitContext *gb, VLC *table, int coeff_index, int plane, int eob_run) |
static void | reverse_dc_prediction (Vp3DecodeContext *s, int first_fragment, int fragment_width, int fragment_height) |
static int | unpack_dct_coeffs (Vp3DecodeContext *s, GetBitContext *gb) |
static void | apply_loop_filter (Vp3DecodeContext *s, int plane, int ystart, int yend) |
static int | vp3_dequant (Vp3DecodeContext *s, Vp3Fragment *frag, int plane, int inter, DCTELEM block[64]) |
Pull DCT tokens from the 64 levels to decode and dequant the coefficients for the next block in coding order. | |
static void | vp3_draw_horiz_band (Vp3DecodeContext *s, int y) |
called when all pixels up to row y are complete | |
static void | await_reference_row (Vp3DecodeContext *s, Vp3Fragment *fragment, int motion_y, int y) |
Wait for the reference frame of the current fragment. | |
static void | render_slice (Vp3DecodeContext *s, int slice) |
static av_cold int | allocate_tables (AVCodecContext *avctx) |
Allocate tables for per-frame data in Vp3DecodeContext. | |
static av_cold int | vp3_decode_init (AVCodecContext *avctx) |
static void | update_frames (AVCodecContext *avctx) |
Release and shuffle frames after decode finishes. | |
static int | vp3_update_thread_context (AVCodecContext *dst, const AVCodecContext *src) |
static int | vp3_decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) |
static int | read_huffman_tree (AVCodecContext *avctx, GetBitContext *gb) |
static int | vp3_init_thread_copy (AVCodecContext *avctx) |
Variables | |
static const int | ModeAlphabet [6][CODING_MODE_COUNT] |
static const uint8_t | hilbert_offset [16][2] |
AVCodec | ff_vp3_decoder |
VP3 Video Decoder by Mike Melanson (mike at multimedia.cx) For more information about the VP3 coding process, visit: http://wiki.multimedia.cx/index.php?title=On2_VP3
Theora decoder by Alex Beregszaszi
Definition in file vp3.c.
#define BLOCK_X (2*mb_x + (k&1)) |
Referenced by unpack_modes(), and unpack_vectors().
#define BLOCK_Y (2*mb_y + (k>>1)) |
Referenced by unpack_modes(), and unpack_vectors().
#define CODING_MODE_COUNT 8 |
#define COMPATIBLE_FRAME | ( | x | ) | (compatible_frame[s->all_fragments[x].coding_method] == current_frame_type) |
#define copy_fields | ( | to, | |||
from, | |||||
start_field, | |||||
end_field | ) | memcpy(&to->start_field, &from->start_field, (char*)&to->end_field - (char*)&to->start_field) |
#define DC_COEFF | ( | u | ) | s->all_fragments[u].dc |
#define FRAGMENT_PIXELS 8 |
#define MAXIMUM_LONG_BIT_RUN 4129 |
#define MODE_COPY 8 |
Definition at line 76 of file vp3.c.
Referenced by apply_loop_filter(), render_slice(), reverse_dc_prediction(), unpack_modes(), unpack_superblocks(), and unpack_vectors().
#define MODE_GOLDEN_MV 6 |
Definition at line 71 of file vp3.c.
Referenced by await_reference_row(), render_slice(), and unpack_vectors().
#define MODE_INTER_FOURMV 7 |
#define MODE_INTER_LAST_MV 3 |
#define MODE_INTER_NO_MV 0 |
#define MODE_INTER_PLUS_MV 2 |
#define MODE_INTER_PRIOR_LAST 4 |
#define MODE_INTRA 1 |
#define MODE_USING_GOLDEN 5 |
#define PL 1 |
#define PU 4 |
Referenced by reverse_dc_prediction().
#define PUL 8 |
Referenced by reverse_dc_prediction().
#define PUR 2 |
Referenced by reverse_dc_prediction().
#define SB_FULLY_CODED 2 |
#define SB_NOT_CODED 0 |
#define SB_PARTIALLY_CODED 1 |
#define SET_CHROMA_MODES |
Value:
if (frag[s->fragment_start[1]].coding_method != MODE_COPY) \ frag[s->fragment_start[1]].coding_method = coding_mode;\ if (frag[s->fragment_start[2]].coding_method != MODE_COPY) \ frag[s->fragment_start[2]].coding_method = coding_mode;
Referenced by unpack_modes().
#define TOKEN_EOB | ( | eob_run | ) | ((eob_run) << 2) |
static av_cold int allocate_tables | ( | AVCodecContext * | avctx | ) | [static] |
Allocate tables for per-frame data in Vp3DecodeContext.
Definition at line 1623 of file vp3.c.
Referenced by vp3_decode_init(), and vp3_update_thread_context().
static void apply_loop_filter | ( | Vp3DecodeContext * | s, | |
int | plane, | |||
int | ystart, | |||
int | yend | |||
) | [static] |
static void await_reference_row | ( | Vp3DecodeContext * | s, | |
Vp3Fragment * | fragment, | |||
int | motion_y, | |||
int | y | |||
) | [static] |
Wait for the reference frame of the current fragment.
The progress value is in luma pixel rows.
Definition at line 1435 of file vp3.c.
Referenced by render_slice().
static int init_block_mapping | ( | Vp3DecodeContext * | s | ) | [static] |
static void init_dequantizer | ( | Vp3DecodeContext * | s, | |
int | qpi | |||
) | [static] |
static void init_loop_filter | ( | Vp3DecodeContext * | s | ) | [static] |
static int read_huffman_tree | ( | AVCodecContext * | avctx, | |
GetBitContext * | gb | |||
) | [static] |
static void render_slice | ( | Vp3DecodeContext * | s, | |
int | slice | |||
) | [static] |
static void reverse_dc_prediction | ( | Vp3DecodeContext * | s, | |
int | first_fragment, | |||
int | fragment_width, | |||
int | fragment_height | |||
) | [static] |
static int unpack_block_qpis | ( | Vp3DecodeContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
static int unpack_dct_coeffs | ( | Vp3DecodeContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
static int unpack_modes | ( | Vp3DecodeContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
static int unpack_superblocks | ( | Vp3DecodeContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
static int unpack_vectors | ( | Vp3DecodeContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
static int unpack_vlcs | ( | Vp3DecodeContext * | s, | |
GetBitContext * | gb, | |||
VLC * | table, | |||
int | coeff_index, | |||
int | plane, | |||
int | eob_run | |||
) | [static] |
static void update_frames | ( | AVCodecContext * | avctx | ) | [static] |
Release and shuffle frames after decode finishes.
Definition at line 1830 of file vp3.c.
Referenced by vp3_update_thread_context().
static av_cold int vp3_decode_end | ( | AVCodecContext * | avctx | ) | [static] |
static void vp3_decode_flush | ( | AVCodecContext * | avctx | ) | [static] |
static int vp3_decode_frame | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | data_size, | |||
AVPacket * | avpkt | |||
) | [static] |
static av_cold int vp3_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
static int vp3_dequant | ( | Vp3DecodeContext * | s, | |
Vp3Fragment * | frag, | |||
int | plane, | |||
int | inter, | |||
DCTELEM | block[64] | |||
) | [inline, static] |
Pull DCT tokens from the 64 levels to decode and dequant the coefficients for the next block in coding order.
Definition at line 1350 of file vp3.c.
Referenced by render_slice().
static void vp3_draw_horiz_band | ( | Vp3DecodeContext * | s, | |
int | y | |||
) | [static] |
called when all pixels up to row y are complete
Definition at line 1395 of file vp3.c.
Referenced by render_slice().
static int vp3_init_thread_copy | ( | AVCodecContext * | avctx | ) | [static] |
static int vp3_update_thread_context | ( | AVCodecContext * | dst, | |
const AVCodecContext * | src | |||
) | [static] |
Initial value:
{ .name = "vp3", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VP3, .priv_data_size = sizeof(Vp3DecodeContext), .init = vp3_decode_init, .close = vp3_decode_end, .decode = vp3_decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, .long_name = NULL_IF_CONFIG_SMALL("On2 VP3"), .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp3_init_thread_copy), .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context), }
const uint8_t hilbert_offset[16][2] [static] |
Initial value:
{ {0,0}, {1,0}, {1,1}, {0,1}, {0,2}, {0,3}, {1,3}, {1,2}, {2,2}, {2,3}, {3,3}, {3,2}, {3,1}, {2,1}, {2,0}, {3,0} }
Definition at line 119 of file vp3.c.
Referenced by init_block_mapping(), and render_slice().
const int ModeAlphabet[6][CODING_MODE_COUNT] [static] |