Sorenson Vector Quantizer #1 (SVQ1) video codec.
More...
#include "avcodec.h"
#include "get_bits.h"
#include "h263.h"
#include "hpeldsp.h"
#include "internal.h"
#include "mathops.h"
#include "svq1.h"
|
| #define | SVQ1_PROCESS_VECTOR() |
| |
| #define | SVQ1_ADD_CODEBOOK() |
| |
| #define | SVQ1_CALC_CODEBOOK_ENTRIES(cbook) |
| |
Sorenson Vector Quantizer #1 (SVQ1) video codec.
For more information of the SVQ1 algorithm, visit: http://www.pcisys.net/~melanson/codecs/
§ SVQ1_ADD_CODEBOOK
| #define SVQ1_ADD_CODEBOOK |
( |
| ) |
|
Value: \
for (j = 0; j < stages; j++) { \
n3 = codebook[entries[j]] ^ 0x80808080; \
n1 += (n3 & 0xFF00FF00) >> 8; \
n2 += n3 & 0x00FF00FF; \
} \
\
\
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; \
}
§ SVQ1_CALC_CODEBOOK_ENTRIES
| #define SVQ1_CALC_CODEBOOK_ENTRIES |
( |
|
cbook | ) |
|
Value:codebook = (const uint32_t *)cbook[level]; \
if (stages > 0) \
bit_cache = get_bits(bitbuf, 4 * stages); \
\
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;
§ SVQ1_PROCESS_VECTOR
| #define SVQ1_PROCESS_VECTOR |
( |
| ) |
|
Value:for (; level > 0; i++) { \
\
if (i == m) { \
m = n; \
if (--level == 0) \
break; \
} \
\
if (!get_bits1(bitbuf)) \
break; \
\
list[n++] = list[i]; \
list[n++] = list[i] + (((level & 1) ? pitch : 1) << ((level >> 1) + 1));\
}
§ ff_svq1_decoder
Initial value:= {
.name = "svq1",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_SVQ1,
.init = svq1_decode_init,
.close = svq1_decode_end,
.decode = svq1_decode_frame,
.flush = svq1_flush,
AV_PIX_FMT_NONE },
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:68
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959