summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/motion_est_template.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-03-26 14:43:46 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-03-26 14:43:46 +0000
commita5adaebc130805962f83deccb29f47a7a2384fc8 (patch)
tree50ce22f99ced67b6d975632574ce4b392ed820ad /src/libffmpeg/libavcodec/motion_est_template.c
parent689bd7704fde776152e6883ce1b6022ec638304b (diff)
downloadxine-lib-a5adaebc130805962f83deccb29f47a7a2384fc8.tar.gz
xine-lib-a5adaebc130805962f83deccb29f47a7a2384fc8.tar.bz2
update ffmpeg. trying to keep local changes (see diff_to_ffmpeg_cvs.txt), let me
know if i overlooked something. as usual, preliminary QA: tested non debug builds and several codecs including divx3/4/5, mpeg4, xvid, msmpeg4v3, svq1, wmv7, dv (video/audio), wma i also enabled wmv8 by default since it worked fine with the streams i have. i'm not sure about current state of that so we might enable it only for non-x86 users in case of trouble. CVS patchset: 4488 CVS date: 2003/03/26 14:43:46
Diffstat (limited to 'src/libffmpeg/libavcodec/motion_est_template.c')
-rw-r--r--src/libffmpeg/libavcodec/motion_est_template.c50
1 files changed, 22 insertions, 28 deletions
diff --git a/src/libffmpeg/libavcodec/motion_est_template.c b/src/libffmpeg/libavcodec/motion_est_template.c
index f1ce615ae..f393fd88a 100644
--- a/src/libffmpeg/libavcodec/motion_est_template.c
+++ b/src/libffmpeg/libavcodec/motion_est_template.c
@@ -17,8 +17,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
-#include "xineutils.h"
+
+/**
+ * @file motion_est_template.c
+ * Motion estimation template.
+ */
//lets hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...)
//Note, the last line is there to kill these ugly unused var warnings
@@ -121,9 +124,7 @@ static int RENAME(hpel_motion_search)(MpegEncContext * s,
CHECK_HALF_MV(0, 1, mx , my )
CHECK_HALF_MV(1, 1, mx , my )
- XINE_ASSERT((bx >= xmin*2 || bx <= xmax*2 || by >= ymin*2 || by <= ymax*2),
- "bx (%d) is not wihtin range %d to %d.\nby (%d) is not within range %d to %d",
- bx, xmin*2, xmax*2, by, ymin*2, ymax*2);
+ assert(bx >= xmin*2 || bx <= xmax*2 || by >= ymin*2 || by <= ymax*2);
*mx_ptr = bx;
*my_ptr = by;
@@ -187,14 +188,13 @@ static int RENAME(hpel_motion_search)(MpegEncContext * s,
int map_generation= s->me.map_generation;
uint32_t *map= s->me.map;
key= ((my-1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
-
- XINE_ASSERT(map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key,"map[%d] != %d",(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1), key );
+ assert(map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
key= ((my+1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
- XINE_ASSERT(map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key,"map[%d] != %d",(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1), key);
+ assert(map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
key= ((my)<<ME_MAP_MV_BITS) + (mx+1) + map_generation;
- XINE_ASSERT(map[(index+1)&(ME_MAP_SIZE-1)] == key, "map[%d] != %d",(index+1)&(ME_MAP_SIZE-1), key);
+ assert(map[(index+1)&(ME_MAP_SIZE-1)] == key);
key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;
- XINE_ASSERT(map[(index-1)&(ME_MAP_SIZE-1)] == key, "map[%d] != %d",(index-1)&(ME_MAP_SIZE-1), key);
+ assert(map[(index-1)&(ME_MAP_SIZE-1)] == key);
#endif
if(t<=b){
CHECK_HALF_MV(0, 1, mx ,my-1)
@@ -235,9 +235,7 @@ static int RENAME(hpel_motion_search)(MpegEncContext * s,
}
CHECK_HALF_MV(0, 1, mx , my)
}
- XINE_ASSERT((bx >= xmin*2 && bx <= xmax*2 && by >= ymin*2 && by <= ymax*2),
- "bx (%d) is not wihtin range %d to %d.\nby (%d) is not within range %d to %d",
- bx, xmin*2, xmax*2, by, ymin*2, ymax*2);
+ assert(bx >= xmin*2 && bx <= xmax*2 && by >= ymin*2 && by <= ymax*2);
}
*mx_ptr = bx;
@@ -267,9 +265,8 @@ static int RENAME(hpel_get_mb_score)(MpegEncContext * s, int mx, int my, int pre
cmp_sub= s->dsp.mb_cmp[size];
chroma_cmp_sub= s->dsp.mb_cmp[size+1];
- XINE_ASSERT(!s->me.skip,"s->me.skip is not NULL");
- XINE_ASSERT((s->avctx->me_sub_cmp != s->avctx->mb_cmp), "s->avctx->me_sub_cmp (%d) != s->avctx->mb_cmp (%d)",
- s->avctx->me_sub_cmp, s->avctx->mb_cmp );
+ assert(!s->me.skip);
+ assert(s->avctx->me_sub_cmp != s->avctx->mb_cmp);
CMP_HPEL(d, mx&1, my&1, mx>>1, my>>1, size);
//FIXME check cbp before adding penalty for (0,0) vector
@@ -397,12 +394,11 @@ static int RENAME(qpel_motion_search)(MpegEncContext * s,
cxy= 2*tl + (cx + cy)/4 - (cx2 + cy2) - 2*c;
- XINE_ASSERT(16*cx2 + 4*cx + 32*c == 32*r, "%d != %d",16*cx2 + 4*cx + 32*c, 32*r);
- XINE_ASSERT(16*cx2 - 4*cx + 32*c == 32*l, "%d != %d",16*cx2 - 4*cx + 32*c, 32*l);
- XINE_ASSERT(16*cy2 + 4*cy + 32*c == 32*b, "%d != %d",16*cy2 + 4*cy + 32*c, 32*b);
- XINE_ASSERT(16*cy2 - 4*cy + 32*c == 32*t, "%d != %d",16*cy2 - 4*cy + 32*c, 32*t);
- XINE_ASSERT(16*cxy + 16*cy2 + 16*cx2 - 4*cy - 4*cx + 32*c == 32*tl, "%d != %d",
- 16*cxy + 16*cy2 + 16*cx2 - 4*cy - 4*cx + 32*c, 32*tl);
+ assert(16*cx2 + 4*cx + 32*c == 32*r);
+ assert(16*cx2 - 4*cx + 32*c == 32*l);
+ assert(16*cy2 + 4*cy + 32*c == 32*b);
+ assert(16*cy2 - 4*cy + 32*c == 32*t);
+ assert(16*cxy + 16*cy2 + 16*cx2 - 4*cy - 4*cx + 32*c == 32*tl);
for(ny= -3; ny <= 3; ny++){
for(nx= -3; nx <= 3; nx++){
@@ -504,9 +500,7 @@ static int RENAME(qpel_motion_search)(MpegEncContext * s,
CHECK_QUARTER_MV(1, 1, mx-1, my )
CHECK_QUARTER_MV(1, 0, mx-1, my )
#endif
- XINE_ASSERT(bx >= xmin*4 && bx <= xmax*4 && by >= ymin*4 && by <= ymax*4,
- "bx (%d) is not wihtin range %d to %d.\nby (%d) is not within range %d to %d",
- bx, xmin*4, xmax*4, by, ymin*4, ymax*4);
+ assert(bx >= xmin*4 && bx <= xmax*4 && by >= ymin*4 && by <= ymax*4);
*mx_ptr = bx;
*my_ptr = by;
@@ -537,8 +531,8 @@ static int RENAME(qpel_get_mb_score)(MpegEncContext * s, int mx, int my, int pre
cmp_sub= s->dsp.mb_cmp[size];
chroma_cmp_sub= s->dsp.mb_cmp[size+1];
- XINE_ASSERT(!s->me.skip, "value 's->me.skip' is not NULL");
- XINE_ASSERT(s->avctx->me_sub_cmp != s->avctx->mb_cmp, "%d != %d", s->avctx->me_sub_cmp, s->avctx->mb_cmp );
+ assert(!s->me.skip);
+ assert(s->avctx->me_sub_cmp != s->avctx->mb_cmp);
CMP_QPEL(d, mx&3, my&3, mx>>2, my>>2, size);
//FIXME check cbp before adding penalty for (0,0) vector
@@ -756,7 +750,7 @@ static inline int RENAME(sab_diamond_search)(MpegEncContext * s, int *best, int
if((key&((-1)<<(2*ME_MAP_MV_BITS))) != map_generation) continue;
- XINE_ASSERT(j<MAX_SAB_SIZE, "%d >= %d", j, MAX_SAB_SIZE); //max j = number of predictors
+ assert(j<MAX_SAB_SIZE); //max j = number of predictors
minima[j].height= score_map[i];
minima[j].x= key & ((1<<ME_MAP_MV_BITS)-1); key>>=ME_MAP_MV_BITS;