changeset 7614:1afa1171b7b2 libavcodec

Introducing DV_MAX_BPM macro instead of a hardcoded value for the highest number of blocks per macroblock
author romansh
date Tue, 19 Aug 2008 16:00:26 +0000
parents ff395fe35161
children 290fd3ae1219
files dv.c dvdata.h
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dv.c	Tue Aug 19 10:43:47 2008 +0000
+++ b/dv.c	Tue Aug 19 16:00:26 2008 +0000
@@ -360,8 +360,8 @@
     const uint8_t *buf_ptr;
     PutBitContext pb, vs_pb;
     GetBitContext gb;
-    BlockInfo mb_data[5 * 6], *mb, *mb1;
-    DECLARE_ALIGNED_16(DCTELEM, sblock[5*6][64]);
+    BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1;
+    DECLARE_ALIGNED_16(DCTELEM, sblock[5*DV_MAX_BPM][64]);
     DECLARE_ALIGNED_8(uint8_t, mb_bit_buffer[80 + 4]); /* allow some slack */
     DECLARE_ALIGNED_8(uint8_t, vs_bit_buffer[5 * 80 + 4]); /* allow some slack */
     const int log2_blocksize= 3-s->avctx->lowres;
--- a/dvdata.h	Tue Aug 19 10:43:47 2008 +0000
+++ b/dvdata.h	Tue Aug 19 16:00:26 2008 +0000
@@ -2638,6 +2638,9 @@
 /* largest possible DV frame, in bytes (PAL 50Mbps) */
 #define DV_MAX_FRAME_SIZE 288000
 
+/* maximum number of blocks per macroblock in any DV format */
+#define DV_MAX_BPM 8
+
 static inline const DVprofile* dv_frame_profile(const uint8_t* frame)
 {
     if ((frame[3] & 0x80) == 0) {      /* DSF flag */