#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#include "mathops.h"
#include "svq1.h"
#include <assert.h>
Go to the source code of this file.
For more information of the SVQ1 algorithm, visit: http://www.pcisys.net/~melanson/codecs/
Definition in file svq1dec.c.
#define SVQ1_ADD_CODEBOOK | ( | ) |
Value:
/* add codebook entries to vector */\ for (j=0; j < stages; j++) {\ n3 = codebook[entries[j]] ^ 0x80808080;\ n1 += ((n3 & 0xFF00FF00) >> 8);\ n2 += (n3 & 0x00FF00FF);\ }\ \ /* clip to [0..255] */\ if (n1 & 0xFF00FF00) {\ n3 = ((( n1 >> 15) & 0x00010001) | 0x01000100) - 0x00010001;\ n1 += 0x7F007F00;\ n1 |= (((~n1 >> 15) & 0x00010001) | 0x01000100) - 0x00010001;\ n1 &= (n3 & 0x00FF00FF);\ }\ \ if (n2 & 0xFF00FF00) {\ n3 = ((( n2 >> 15) & 0x00010001) | 0x01000100) - 0x00010001;\ n2 += 0x7F007F00;\ n2 |= (((~n2 >> 15) & 0x00010001) | 0x01000100) - 0x00010001;\ n2 &= (n3 & 0x00FF00FF);\ }
#define SVQ1_CALC_CODEBOOK_ENTRIES | ( | cbook | ) |
Value:
codebook = (const uint32_t *) cbook[level];\ if (stages > 0)\ bit_cache = get_bits (bitbuf, 4*stages);\ /* calculate codebook entries for this vector */\ for (j=0; j < stages; j++) {\ entries[j] = (((bit_cache >> (4*(stages - j - 1))) & 0xF) + 16*j) << (level + 1);\ }\ mean -= (stages * 128);\ n4 = (mean << 16) + mean;
Definition at line 161 of file svq1dec.c.
Referenced by svq1_decode_block_intra(), and svq1_decode_block_non_intra().
#define SVQ1_DO_CODEBOOK_INTRA | ( | ) |
Value:
for (y=0; y < height; y++) {\ for (x=0; x < (width / 4); x++, codebook++) {\ n1 = n4;\ n2 = n4;\ SVQ1_ADD_CODEBOOK()\ /* store result */\ dst[x] = (n1 << 8) | n2;\ }\ dst += (pitch / 4);\ }
Definition at line 135 of file svq1dec.c.
Referenced by svq1_decode_block_intra().
#define SVQ1_DO_CODEBOOK_NONINTRA | ( | ) |
Value:
for (y=0; y < height; y++) {\ for (x=0; x < (width / 4); x++, codebook++) {\ n3 = dst[x];\ /* add mean value to vector */\ n1 = ((n3 & 0xFF00FF00) >> 8) + n4;\ n2 = (n3 & 0x00FF00FF) + n4;\ SVQ1_ADD_CODEBOOK()\ /* store result */\ dst[x] = (n1 << 8) | n2;\ }\ dst += (pitch / 4);\ }
Definition at line 147 of file svq1dec.c.
Referenced by svq1_decode_block_non_intra().
#define SVQ1_PROCESS_VECTOR | ( | ) |
Value:
for (; level > 0; i++) {\ /* process next depth */\ if (i == m) {\ m = n;\ if (--level == 0)\ break;\ }\ /* divide block if next bit set */\ if (get_bits1 (bitbuf) == 0)\ break;\ /* add child nodes */\ list[n++] = list[i];\ list[n++] = list[i] + (((level & 1) ? pitch : 1) << ((level >> 1) + 1));\ }
Definition at line 96 of file svq1dec.c.
Referenced by svq1_decode_block_intra(), and svq1_decode_block_non_intra().
typedef struct svq1_pmv_s svq1_pmv |
static int svq1_decode_block_intra | ( | GetBitContext * | bitbuf, | |
uint8_t * | pixels, | |||
int | pitch | |||
) | [static] |
Definition at line 172 of file svq1dec.c.
Referenced by svq1_decode_delta_block(), and svq1_decode_frame().
static int svq1_decode_block_non_intra | ( | GetBitContext * | bitbuf, | |
uint8_t * | pixels, | |||
int | pitch | |||
) | [static] |
static int svq1_decode_delta_block | ( | MpegEncContext * | s, | |
GetBitContext * | bitbuf, | |||
uint8_t * | current, | |||
uint8_t * | previous, | |||
int | pitch, | |||
svq1_pmv * | motion, | |||
int | x, | |||
int | y | |||
) | [static] |
static av_cold int svq1_decode_end | ( | AVCodecContext * | avctx | ) | [static] |
static int svq1_decode_frame | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | data_size, | |||
AVPacket * | avpkt | |||
) | [static] |
static int svq1_decode_frame_header | ( | GetBitContext * | bitbuf, | |
MpegEncContext * | s | |||
) | [static] |
static av_cold int svq1_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
static int svq1_decode_motion_vector | ( | GetBitContext * | bitbuf, | |
svq1_pmv * | mv, | |||
svq1_pmv ** | pmv | |||
) | [static] |
Definition at line 270 of file svq1dec.c.
Referenced by svq1_motion_inter_4v_block(), and svq1_motion_inter_block().
static int svq1_motion_inter_4v_block | ( | MpegEncContext * | s, | |
GetBitContext * | bitbuf, | |||
uint8_t * | current, | |||
uint8_t * | previous, | |||
int | pitch, | |||
svq1_pmv * | motion, | |||
int | x, | |||
int | y | |||
) | [static] |
XXX /FIXME clipping or padding?
Definition at line 354 of file svq1dec.c.
Referenced by svq1_decode_delta_block().
static int svq1_motion_inter_block | ( | MpegEncContext * | s, | |
GetBitContext * | bitbuf, | |||
uint8_t * | current, | |||
uint8_t * | previous, | |||
int | pitch, | |||
svq1_pmv * | motion, | |||
int | x, | |||
int | y | |||
) | [static] |
static void svq1_parse_string | ( | GetBitContext * | bitbuf, | |
uint8_t * | out | |||
) | [static] |
Definition at line 91 of file h263data.h.
Initial value:
{ .name = "svq1", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_SVQ1, .priv_data_size = sizeof(MpegEncContext), .init = svq1_decode_init, .close = svq1_decode_end, .decode = svq1_decode_frame, .capabilities = CODEC_CAP_DR1, .flush = ff_mpeg_flush, .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV410P, PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), }
const uint8_t string_table[256] [static] |
VLC svq1_block_type [static] |
VLC svq1_inter_mean [static] |
VLC svq1_inter_multistage[6] [static] |
VLC svq1_intra_mean [static] |
VLC svq1_intra_multistage[6] [static] |
VLC svq1_motion_component [static] |