aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/svq1dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-13 11:53:09 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-13 11:53:15 +0100
commit9c0ec23c7dde8a2d6a356fa21cf3339b208467cf (patch)
tree0a088938209af2c626087587864be5002479c7dc /libavcodec/svq1dec.c
parente7f255d89b587ce78b17d1bd45521d21ff10822b (diff)
parent998fdcff41bbda8ef13c991743376556f910efa9 (diff)
downloadffmpeg-9c0ec23c7dde8a2d6a356fa21cf3339b208467cf.tar.gz
Merge commit '998fdcff41bbda8ef13c991743376556f910efa9'
* commit '998fdcff41bbda8ef13c991743376556f910efa9': lavc: replace some forgotten instances of PixelFormat with AVPixelFormat svq1: unmacroify macros used only once. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/svq1dec.c')
-rw-r--r--libavcodec/svq1dec.c56
1 files changed, 26 insertions, 30 deletions
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index a76ac7114e..187522c3bf 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -141,32 +141,6 @@ static const uint8_t string_table[256] = {
n2 &= n3 & 0x00FF00FF; \
}
-#define SVQ1_DO_CODEBOOK_INTRA() \
- 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; \
- }
-
-#define SVQ1_DO_CODEBOOK_NONINTRA() \
- for (y = 0; y < height; y++) { \
- for (x = 0; x < width / 4; x++, codebook++) { \
- n3 = dst[x]; \
- /* add mean value to vector */ \
- n1 = n4 + ((n3 & 0xFF00FF00) >> 8); \
- n2 = n4 + (n3 & 0x00FF00FF); \
- SVQ1_ADD_CODEBOOK() \
- /* store result */ \
- dst[x] = n1 << 8 | n2; \
- } \
- dst += pitch / 4; \
- }
-
#define SVQ1_CALC_CODEBOOK_ENTRIES(cbook) \
codebook = (const uint32_t *)cbook[level]; \
if (stages > 0) \
@@ -227,7 +201,17 @@ static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels,
memset(&dst[y * (pitch / 4)], mean, width);
} else {
SVQ1_CALC_CODEBOOK_ENTRIES(ff_svq1_intra_codebooks);
- SVQ1_DO_CODEBOOK_INTRA()
+
+ 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;
+ }
}
}
@@ -275,7 +259,19 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels,
mean = get_vlc2(bitbuf, svq1_inter_mean.table, 9, 3) - 256;
SVQ1_CALC_CODEBOOK_ENTRIES(ff_svq1_inter_codebooks);
- SVQ1_DO_CODEBOOK_NONINTRA()
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width / 4; x++, codebook++) {
+ n3 = dst[x];
+ /* add mean value to vector */
+ n1 = n4 + ((n3 & 0xFF00FF00) >> 8);
+ n2 = n4 + (n3 & 0x00FF00FF);
+ SVQ1_ADD_CODEBOOK()
+ /* store result */
+ dst[x] = n1 << 8 | n2;
+ }
+ dst += pitch / 4;
+ }
}
return 0;
}
@@ -832,7 +828,7 @@ AVCodec ff_svq1_decoder = {
.decode = svq1_decode_frame,
.capabilities = CODEC_CAP_DR1,
.flush = svq1_flush,
- .pix_fmts = (const enum PixelFormat[]) { AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_NONE },
+ .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
};