aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-28 16:28:48 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-28 16:28:48 +0200
commit416d2f7a1244e7e93e291786ac98313153f87db5 (patch)
tree231d0d704cda257e4bc2a210df6b2fe553f407c6 /libavcodec/vc1dec.c
parentfb6fb0dedbc103ba9cd4e7d63edee15317143b21 (diff)
parent7627c35a81241c98768d2d1f13d576591cac0b1c (diff)
downloadffmpeg-416d2f7a1244e7e93e291786ac98313153f87db5.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: vc1: export some functions configure: use HOSTCC_C/O in check_host_cc configure: use AS_O setting in check_as configure: use LD_O setting in check_ld() Revert "dsputil: make {add/put/put_signed}_pixels_clamped() non-static." build: Restore dependency of acelp_filters.o on celp_math.o celp_math: Replace duplicate ff_dot_productf() by ff_scalarproduct_c() celp_math: Move ff_cos() to the only place it is used build: Use portable abstraction for linker/hostcc output file syntax configure: Fix shared library creation for OpenBSD vp56: Don't use DECLARE_ALIGN on a typedef name mss1: move code that will be reused by MSS2 decoder into separate file mss1: merge decode_intra() and decode_inter() avprobe: Get rid of ugly casts in the options table vf_hqdn3d: Remove a duplicate inline declaration Conflicts: Makefile configure ffprobe.c libavcodec/Makefile libavcodec/amrnbdec.c libavcodec/amrwbdec.c libavcodec/celp_math.c libavcodec/celp_math.h libavcodec/dsputil.c libavcodec/lsp.c libavcodec/mss1.c libavcodec/ra288.c libavcodec/vc1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r--libavcodec/vc1dec.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 2fc4913729..0362c1a04f 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -4734,7 +4734,7 @@ static void vc1_decode_skip_blocks(VC1Context *v)
s->pict_type = AV_PICTURE_TYPE_P;
}
-static void vc1_decode_blocks(VC1Context *v)
+void ff_vc1_decode_blocks(VC1Context *v)
{
v->s.esc3_level_length = 0;
@@ -5048,7 +5048,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx)
#endif
-static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
+av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
{
MpegEncContext *s = &v->s;
int i;
@@ -5114,6 +5114,21 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
return 0;
}
+av_cold void ff_vc1_init_transposed_scantables(VC1Context *v)
+{
+ int i;
+ for (i = 0; i < 64; i++) {
+#define transpose(x) ((x >> 3) | ((x & 7) << 3))
+ v->zz_8x8[0][i] = transpose(ff_wmv1_scantable[0][i]);
+ v->zz_8x8[1][i] = transpose(ff_wmv1_scantable[1][i]);
+ v->zz_8x8[2][i] = transpose(ff_wmv1_scantable[2][i]);
+ v->zz_8x8[3][i] = transpose(ff_wmv1_scantable[3][i]);
+ v->zzi_8x8[i] = transpose(ff_vc1_adv_interlaced_8x8_zz[i]);
+ }
+ v->left_blk_sh = 0;
+ v->top_blk_sh = 3;
+}
+
/** Initialize a VC1/WMV3 decoder
* @todo TODO: Handle VC-1 IDUs (Transport level?)
* @todo TODO: Decypher remaining bits in extra_data
@@ -5123,7 +5138,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
GetBitContext gb;
- int i;
/* save the container output size for WMImage */
v->output_width = avctx->width;
@@ -5226,16 +5240,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
s->mb_height = (avctx->coded_height + 15) >> 4;
if (v->profile == PROFILE_ADVANCED || v->res_fasttx) {
- for (i = 0; i < 64; i++) {
-#define transpose(x) ((x >> 3) | ((x & 7) << 3))
- v->zz_8x8[0][i] = transpose(ff_wmv1_scantable[0][i]);
- v->zz_8x8[1][i] = transpose(ff_wmv1_scantable[1][i]);
- v->zz_8x8[2][i] = transpose(ff_wmv1_scantable[2][i]);
- v->zz_8x8[3][i] = transpose(ff_wmv1_scantable[3][i]);
- v->zzi_8x8[i] = transpose(ff_vc1_adv_interlaced_8x8_zz[i]);
- }
- v->left_blk_sh = 0;
- v->top_blk_sh = 3;
+ ff_vc1_init_transposed_scantables(v);
} else {
memcpy(v->zz_8x8, ff_wmv1_scantable, 4*64);
v->left_blk_sh = 3;
@@ -5261,7 +5266,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
/** Close a VC1/WMV3 decoder
* @warning Initial try at using MpegEncContext stuff
*/
-static av_cold int vc1_decode_end(AVCodecContext *avctx)
+av_cold int ff_vc1_decode_end(AVCodecContext *avctx)
{
VC1Context *v = avctx->priv_data;
int i;
@@ -5453,11 +5458,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (s->context_initialized &&
(s->width != avctx->coded_width ||
s->height != avctx->coded_height)) {
- vc1_decode_end(avctx);
+ ff_vc1_decode_end(avctx);
}
if (!s->context_initialized) {
- if (ff_msmpeg4_decode_init(avctx) < 0 || vc1_decode_init_alloc_tables(v) < 0)
+ if (ff_msmpeg4_decode_init(avctx) < 0 || ff_vc1_decode_init_alloc_tables(v) < 0)
return -1;
s->low_delay = !avctx->has_b_frames || v->res_sprite;
@@ -5612,7 +5617,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
av_log(v->s.avctx, AV_LOG_ERROR, "end mb y %d %d invalid\n", s->end_mb_y, s->start_mb_y);
continue;
}
- vc1_decode_blocks(v);
+ ff_vc1_decode_blocks(v);
if (i != n_slices)
s->gb = slices[i].gb;
}
@@ -5693,7 +5698,7 @@ AVCodec ff_vc1_decoder = {
.id = AV_CODEC_ID_VC1,
.priv_data_size = sizeof(VC1Context),
.init = vc1_decode_init,
- .close = vc1_decode_end,
+ .close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
.long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"),
@@ -5708,7 +5713,7 @@ AVCodec ff_wmv3_decoder = {
.id = AV_CODEC_ID_WMV3,
.priv_data_size = sizeof(VC1Context),
.init = vc1_decode_init,
- .close = vc1_decode_end,
+ .close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"),
@@ -5724,7 +5729,7 @@ AVCodec ff_wmv3_vdpau_decoder = {
.id = AV_CODEC_ID_WMV3,
.priv_data_size = sizeof(VC1Context),
.init = vc1_decode_init,
- .close = vc1_decode_end,
+ .close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 VDPAU"),
@@ -5740,7 +5745,7 @@ AVCodec ff_vc1_vdpau_decoder = {
.id = AV_CODEC_ID_VC1,
.priv_data_size = sizeof(VC1Context),
.init = vc1_decode_init,
- .close = vc1_decode_end,
+ .close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
.long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1 VDPAU"),
@@ -5756,7 +5761,7 @@ AVCodec ff_wmv3image_decoder = {
.id = AV_CODEC_ID_WMV3IMAGE,
.priv_data_size = sizeof(VC1Context),
.init = vc1_decode_init,
- .close = vc1_decode_end,
+ .close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
.capabilities = CODEC_CAP_DR1,
.flush = vc1_sprite_flush,
@@ -5772,7 +5777,7 @@ AVCodec ff_vc1image_decoder = {
.id = AV_CODEC_ID_VC1IMAGE,
.priv_data_size = sizeof(VC1Context),
.init = vc1_decode_init,
- .close = vc1_decode_end,
+ .close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
.capabilities = CODEC_CAP_DR1,
.flush = vc1_sprite_flush,