return ptr;
}
+void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size)
+{
+ void **p = ptr;
+ if (min_size < *size)
+ return;
+ *size= FFMAX(17*min_size/16 + 32, min_size);
+ av_free(*p);
+ *p = av_malloc(*size);
+ if (!*p) *size = 0;
+}
+
/* encoder management */
static AVCodec *first_avcodec = NULL;
case PIX_FMT_YUVA420P:
w_align= 16; //FIXME check for non mpeg style codecs and use less alignment
h_align= 16;
+ if(s->codec_id == CODEC_ID_MPEG2VIDEO)
+ h_align= 32; // interlaced is rounded up to 2 MBs
break;
case PIX_FMT_YUV411P:
case PIX_FMT_UYYVYY411:
}
int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
- if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/4)
+ if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
return 0;
av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);
#if !HAVE_THREADS
int avcodec_thread_init(AVCodecContext *s, int thread_count){
+ s->thread_count = thread_count;
return -1;
}
#endif