FFmpeg
Loading...
Searching...
No Matches
vp6.c File Reference

VP6 compatible video decoder. More...

#include <stdlib.h>
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "huffman.h"
#include "vp56.h"
#include "vp56data.h"
#include "vp6data.h"
#include "vpx_rac.h"

Go to the source code of this file.

Macros

#define VP6_MAX_HUFF_SIZE   12
 
#define AC_DC_HUFF_BITS   10
 
#define RUN_HUFF_BITS   8
 

Functions

static int vp6_parse_coeff (VP56Context *s)
 
static int vp6_parse_coeff_huffman (VP56Context *s)
 
static int vp6_parse_header (VP56Context *s, const uint8_t *buf, int buf_size)
 
static void vp6_coeff_order_table_init (VP56Context *s)
 
static void vp6_default_models_init (VP56Context *s)
 
static void vp6_parse_vector_models (VP56Context *s)
 
static int vp6_huff_cmp (const void *va, const void *vb)
 
static int vp6_build_huff_tree (VP56Context *s, uint8_t coeff_model[], const uint8_t *map, unsigned size, int nb_bits, VLC *vlc)
 
static int vp6_parse_coeff_models (VP56Context *s)
 
static void vp6_parse_vector_adjustment (VP56Context *s, VP56mv *vect)
 
static unsigned vp6_get_nb_null (VP56Context *s)
 Read number of consecutive blocks with null DC or AC.
 
static int vp6_block_variance (uint8_t *src, ptrdiff_t stride)
 
static void vp6_filter_hv4 (uint8_t *dst, uint8_t *src, ptrdiff_t stride, int delta, const int16_t *weights)
 
static void vp6_filter_diag2 (VP56Context *s, uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h_weight, int v_weight)
 
static void vp6_filter (VP56Context *s, uint8_t *dst, uint8_t *src, int offset1, int offset2, ptrdiff_t stride, VP56mv mv, int mask, int select, int luma)
 
static av_cold int vp6_decode_init_context (AVCodecContext *avctx, VP56Context *s, int flip, int has_alpha)
 
static av_cold int vp6_decode_init (AVCodecContext *avctx)
 
static av_cold void vp6_decode_free_context (VP56Context *s)
 
static av_cold int vp6_decode_free (AVCodecContext *avctx)
 

Variables

const FFCodec ff_vp6_decoder
 
const FFCodec ff_vp6f_decoder
 
const FFCodec ff_vp6a_decoder
 

Detailed Description

VP6 compatible video decoder.

The VP6F decoder accepts an optional 1 byte extradata. It is composed of:

  • upper 4 bits: difference between encoded width and visible width
  • lower 4 bits: difference between encoded height and visible height

Definition in file vp6.c.

Macro Definition Documentation

◆ VP6_MAX_HUFF_SIZE

#define VP6_MAX_HUFF_SIZE   12

Definition at line 43 of file vp6.c.

Referenced by vp6_build_huff_tree().

◆ AC_DC_HUFF_BITS

#define AC_DC_HUFF_BITS   10

Definition at line 44 of file vp6.c.

Referenced by vp6_parse_coeff_huffman(), and vp6_parse_coeff_models().

◆ RUN_HUFF_BITS

#define RUN_HUFF_BITS   8

Definition at line 45 of file vp6.c.

Referenced by vp6_parse_coeff_huffman(), and vp6_parse_coeff_models().

Function Documentation

◆ vp6_parse_coeff()

static int vp6_parse_coeff ( VP56Context * s)
static

Definition at line 485 of file vp6.c.

Referenced by vp6_parse_header().

◆ vp6_parse_coeff_huffman()

static int vp6_parse_coeff_huffman ( VP56Context * s)
static

Definition at line 424 of file vp6.c.

Referenced by vp6_parse_header().

◆ vp6_parse_header()

static int vp6_parse_header ( VP56Context * s,
const uint8_t * buf,
int buf_size )
static

Definition at line 50 of file vp6.c.

Referenced by vp6_decode_init_context().

◆ vp6_coeff_order_table_init()

static void vp6_coeff_order_table_init ( VP56Context * s)
static

Definition at line 198 of file vp6.c.

Referenced by vp6_default_models_init(), and vp6_parse_coeff_models().

◆ vp6_default_models_init()

static void vp6_default_models_init ( VP56Context * s)
static

Definition at line 221 of file vp6.c.

Referenced by vp6_decode_init_context().

◆ vp6_parse_vector_models()

static void vp6_parse_vector_models ( VP56Context * s)
static

Definition at line 239 of file vp6.c.

Referenced by vp6_decode_init_context().

◆ vp6_huff_cmp()

static int vp6_huff_cmp ( const void * va,
const void * vb )
static

Definition at line 264 of file vp6.c.

Referenced by vp6_build_huff_tree().

◆ vp6_build_huff_tree()

static int vp6_build_huff_tree ( VP56Context * s,
uint8_t coeff_model[],
const uint8_t * map,
unsigned size,
int nb_bits,
VLC * vlc )
static

Definition at line 270 of file vp6.c.

Referenced by vp6_parse_coeff_models().

◆ vp6_parse_coeff_models()

static int vp6_parse_coeff_models ( VP56Context * s)
static

Definition at line 293 of file vp6.c.

Referenced by vp6_decode_init_context().

◆ vp6_parse_vector_adjustment()

static void vp6_parse_vector_adjustment ( VP56Context * s,
VP56mv * vect )
static

Definition at line 370 of file vp6.c.

Referenced by vp6_decode_init_context().

◆ vp6_get_nb_null()

static unsigned vp6_get_nb_null ( VP56Context * s)
static

Read number of consecutive blocks with null DC or AC.

This value is < 74.

Definition at line 412 of file vp6.c.

Referenced by vp6_parse_coeff_huffman().

◆ vp6_block_variance()

static int vp6_block_variance ( uint8_t * src,
ptrdiff_t stride )
static

Definition at line 567 of file vp6.c.

Referenced by vp6_filter().

◆ vp6_filter_hv4()

static void vp6_filter_hv4 ( uint8_t * dst,
uint8_t * src,
ptrdiff_t stride,
int delta,
const int16_t * weights )
static

Definition at line 582 of file vp6.c.

Referenced by vp6_filter().

◆ vp6_filter_diag2()

static void vp6_filter_diag2 ( VP56Context * s,
uint8_t * dst,
uint8_t * src,
ptrdiff_t stride,
int h_weight,
int v_weight )
static

Definition at line 599 of file vp6.c.

Referenced by vp6_filter().

◆ vp6_filter()

static void vp6_filter ( VP56Context * s,
uint8_t * dst,
uint8_t * src,
int offset1,
int offset2,
ptrdiff_t stride,
VP56mv mv,
int mask,
int select,
int luma )
static

Definition at line 607 of file vp6.c.

Referenced by vp6_decode_init_context().

◆ vp6_decode_init_context()

static av_cold int vp6_decode_init_context ( AVCodecContext * avctx,
VP56Context * s,
int flip,
int has_alpha )
static

Definition at line 657 of file vp6.c.

Referenced by vp6_decode_init().

◆ vp6_decode_init()

static av_cold int vp6_decode_init ( AVCodecContext * avctx)
static

Definition at line 678 of file vp6.c.

◆ vp6_decode_free_context()

static av_cold void vp6_decode_free_context ( VP56Context * s)
static

Definition at line 716 of file vp6.c.

Referenced by vp6_decode_free().

◆ vp6_decode_free()

static av_cold int vp6_decode_free ( AVCodecContext * avctx)
static

Definition at line 702 of file vp6.c.

Variable Documentation

◆ ff_vp6_decoder

const FFCodec ff_vp6_decoder
Initial value:
= {
.p.name = "vp6",
CODEC_LONG_NAME("On2 VP6"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_VP6,
.priv_data_size = sizeof(VP56Context),
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
@ AV_CODEC_ID_VP6
Definition codec_id.h:141
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition vp56.c:607
static av_cold int vp6_decode_init(AVCodecContext *avctx)
Definition vp6.c:678
static av_cold int vp6_decode_free(AVCodecContext *avctx)
Definition vp6.c:702

Definition at line 729 of file vp6.c.

◆ ff_vp6f_decoder

const FFCodec ff_vp6f_decoder
Initial value:
= {
.p.name = "vp6f",
CODEC_LONG_NAME("On2 VP6 (Flash version)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(VP56Context),
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
@ AV_CODEC_ID_VP6F
Definition codec_id.h:142

Definition at line 743 of file vp6.c.

◆ ff_vp6a_decoder

const FFCodec ff_vp6a_decoder
Initial value:
= {
.p.name = "vp6a",
CODEC_LONG_NAME("On2 VP6 (Flash version, with alpha channel)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = 2 * sizeof(VP56Context),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition codec.h:102
@ AV_CODEC_ID_VP6A
Definition codec_id.h:156

Definition at line 757 of file vp6.c.