[FFmpeg-cvslog] r20229 - in trunk/libavcodec: 8bps.c cscd.c dxa.c flashsvenc.c lcldec.c mmvideo.c qdrw.c roqvideoenc.c smacker.c truemotion2.c tscc.c v210dec.c v210x.c vb.c vmnc.c xan.c zmbv.c zmbvenc.c

reimar subversion
Tue Oct 13 22:13:29 CEST 2009


Author: reimar
Date: Tue Oct 13 22:13:28 2009
New Revision: 20229

Log:
Remove unnecessary calls to avcodec_check_dimensions, the check is already
done at a higher level.

Modified:
   trunk/libavcodec/8bps.c
   trunk/libavcodec/cscd.c
   trunk/libavcodec/dxa.c
   trunk/libavcodec/flashsvenc.c
   trunk/libavcodec/lcldec.c
   trunk/libavcodec/mmvideo.c
   trunk/libavcodec/qdrw.c
   trunk/libavcodec/roqvideoenc.c
   trunk/libavcodec/smacker.c
   trunk/libavcodec/truemotion2.c
   trunk/libavcodec/tscc.c
   trunk/libavcodec/v210dec.c
   trunk/libavcodec/v210x.c
   trunk/libavcodec/vb.c
   trunk/libavcodec/vmnc.c
   trunk/libavcodec/xan.c
   trunk/libavcodec/zmbv.c
   trunk/libavcodec/zmbvenc.c

Modified: trunk/libavcodec/8bps.c
==============================================================================
--- trunk/libavcodec/8bps.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/8bps.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -159,10 +159,6 @@ static av_cold int decode_init(AVCodecCo
 
         c->pic.data[0] = NULL;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
         switch (avctx->bits_per_coded_sample) {
                 case 8:
                         avctx->pix_fmt = PIX_FMT_PAL8;

Modified: trunk/libavcodec/cscd.c
==============================================================================
--- trunk/libavcodec/cscd.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/cscd.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -216,9 +216,6 @@ static int decode_frame(AVCodecContext *
 
 static av_cold int decode_init(AVCodecContext *avctx) {
     CamStudioContext *c = avctx->priv_data;
-    if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
-        return 1;
-    }
     switch (avctx->bits_per_coded_sample) {
         case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
         case 24: avctx->pix_fmt = PIX_FMT_BGR24; break;

Modified: trunk/libavcodec/dxa.c
==============================================================================
--- trunk/libavcodec/dxa.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/dxa.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -295,10 +295,6 @@ static av_cold int decode_init(AVCodecCo
     c->avctx = avctx;
     avctx->pix_fmt = PIX_FMT_PAL8;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
-
     c->dsize = avctx->width * avctx->height * 2;
     if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {
         av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");

Modified: trunk/libavcodec/flashsvenc.c
==============================================================================
--- trunk/libavcodec/flashsvenc.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/flashsvenc.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -108,10 +108,6 @@ static av_cold int flashsv_encode_init(A
         return -1;
     }
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
-
     // Needed if zlib unused or init aborted before deflateInit
     memset(&(s->zstream), 0, sizeof(z_stream));
 

Modified: trunk/libavcodec/lcldec.c
==============================================================================
--- trunk/libavcodec/lcldec.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/lcldec.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -458,10 +458,6 @@ static av_cold int decode_init(AVCodecCo
         return 1;
     }
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
     /* Check codec type */
     if ((avctx->codec_id == CODEC_ID_MSZH  && avctx->extradata[7] != CODEC_MSZH) ||
         (avctx->codec_id == CODEC_ID_ZLIB  && avctx->extradata[7] != CODEC_ZLIB)) {

Modified: trunk/libavcodec/mmvideo.c
==============================================================================
--- trunk/libavcodec/mmvideo.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/mmvideo.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -58,9 +58,6 @@ static av_cold int mm_decode_init(AVCode
 
     avctx->pix_fmt = PIX_FMT_PAL8;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height))
-        return -1;
-
     s->frame.reference = 1;
     if (avctx->get_buffer(avctx, &s->frame)) {
         av_log(s->avctx, AV_LOG_ERROR, "mmvideo: get_buffer() failed\n");

Modified: trunk/libavcodec/qdrw.c
==============================================================================
--- trunk/libavcodec/qdrw.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/qdrw.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -135,10 +135,6 @@ static int decode_frame(AVCodecContext *
 static av_cold int decode_init(AVCodecContext *avctx){
 //    QdrawContext * const a = avctx->priv_data;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
     avctx->pix_fmt= PIX_FMT_PAL8;
 
     return 0;

Modified: trunk/libavcodec/roqvideoenc.c
==============================================================================
--- trunk/libavcodec/roqvideoenc.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/roqvideoenc.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -939,12 +939,6 @@ static int roq_encode_init(AVCodecContex
     if (((avctx->width)&(avctx->width-1))||((avctx->height)&(avctx->height-1)))
         av_log(avctx, AV_LOG_ERROR, "Warning: dimensions not power of two\n");
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height)) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n",
-               avctx->width, avctx->height);
-        return -1;
-    }
-
     enc->width = avctx->width;
     enc->height = avctx->height;
 

Modified: trunk/libavcodec/smacker.c
==============================================================================
--- trunk/libavcodec/smacker.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/smacker.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -514,10 +514,6 @@ static av_cold int decode_init(AVCodecCo
 
     c->avctx = avctx;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
     avctx->pix_fmt = PIX_FMT_PAL8;
 
 

Modified: trunk/libavcodec/truemotion2.c
==============================================================================
--- trunk/libavcodec/truemotion2.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/truemotion2.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -813,9 +813,6 @@ static av_cold int decode_init(AVCodecCo
     TM2Context * const l = avctx->priv_data;
     int i;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
     if((avctx->width & 3) || (avctx->height & 3)){
         av_log(avctx, AV_LOG_ERROR, "Width and height must be multiple of 4\n");
         return -1;

Modified: trunk/libavcodec/tscc.c
==============================================================================
--- trunk/libavcodec/tscc.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/tscc.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -141,10 +141,6 @@ static av_cold int decode_init(AVCodecCo
 
     c->height = avctx->height;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
     // Needed if zlib unused or init aborted before inflateInit
     memset(&(c->zstream), 0, sizeof(z_stream));
     switch(avctx->bits_per_coded_sample){

Modified: trunk/libavcodec/v210dec.c
==============================================================================
--- trunk/libavcodec/v210dec.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/v210dec.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -30,8 +30,6 @@ static av_cold int decode_init(AVCodecCo
         av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
         return -1;
     }
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
-        return -1;
     avctx->pix_fmt             = PIX_FMT_YUV422P16;
     avctx->bits_per_raw_sample = 10;
 

Modified: trunk/libavcodec/v210x.c
==============================================================================
--- trunk/libavcodec/v210x.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/v210x.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -27,8 +27,6 @@ static av_cold int decode_init(AVCodecCo
         av_log(avctx, AV_LOG_ERROR, "v210x needs even width\n");
         return -1;
     }
-    if(avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
-        return -1;
     avctx->pix_fmt = PIX_FMT_YUV422P16;
     avctx->bits_per_raw_sample= 10;
 

Modified: trunk/libavcodec/vb.c
==============================================================================
--- trunk/libavcodec/vb.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/vb.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -251,10 +251,6 @@ static av_cold int decode_init(AVCodecCo
     c->avctx = avctx;
     avctx->pix_fmt = PIX_FMT_PAL8;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
-
     c->frame      = av_malloc( avctx->width * avctx->height);
     c->prev_frame = av_malloc( avctx->width * avctx->height);
 

Modified: trunk/libavcodec/vmnc.c
==============================================================================
--- trunk/libavcodec/vmnc.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/vmnc.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -468,9 +468,6 @@ static av_cold int decode_init(AVCodecCo
     c->width = avctx->width;
     c->height = avctx->height;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
     c->bpp = avctx->bits_per_coded_sample;
     c->bpp2 = c->bpp/8;
 

Modified: trunk/libavcodec/xan.c
==============================================================================
--- trunk/libavcodec/xan.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/xan.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -74,9 +74,6 @@ static av_cold int xan_decode_init(AVCod
 
     avctx->pix_fmt = PIX_FMT_PAL8;
 
-    if(avcodec_check_dimensions(avctx, avctx->width, avctx->height))
-        return -1;
-
     s->buffer1_size = avctx->width * avctx->height;
     s->buffer1 = av_malloc(s->buffer1_size);
     s->buffer2_size = avctx->width * avctx->height;

Modified: trunk/libavcodec/zmbv.c
==============================================================================
--- trunk/libavcodec/zmbv.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/zmbv.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -602,9 +602,6 @@ static av_cold int decode_init(AVCodecCo
     c->width = avctx->width;
     c->height = avctx->height;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
     c->bpp = avctx->bits_per_coded_sample;
 
     // Needed if zlib unused or init aborted before inflateInit

Modified: trunk/libavcodec/zmbvenc.c
==============================================================================
--- trunk/libavcodec/zmbvenc.c	Tue Oct 13 20:31:22 2009	(r20228)
+++ trunk/libavcodec/zmbvenc.c	Tue Oct 13 22:13:28 2009	(r20229)
@@ -263,10 +263,6 @@ static av_cold int encode_init(AVCodecCo
         return -1;
     }
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
-
     // Needed if zlib unused or init aborted before deflateInit
     memset(&(c->zstream), 0, sizeof(z_stream));
     c->comp_size = avctx->width * avctx->height + 1024 +



More information about the ffmpeg-cvslog mailing list