diff options
Diffstat (limited to 'libavcodec/msmpeg4.c')
-rw-r--r-- | libavcodec/msmpeg4.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index f844850c40..a054520e79 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -5,20 +5,20 @@ * * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni@gmx.at> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -36,6 +36,7 @@ #include "mpeg4video.h" #include "msmpeg4data.h" #include "vc1data.h" +#include "libavutil/imgutils.h" /* * You can also call this codec : MPEG4 with a twist ! @@ -51,6 +52,9 @@ static av_cold void init_h263_dc_for_msmpeg4(void) { int level, uni_code, uni_len; + if(ff_v2_dc_chroma_table[255 + 256][1]) + return; + for(level=-256; level<256; level++){ int size, v, l; /* find number of bits */ @@ -103,8 +107,6 @@ static av_cold void init_h263_dc_for_msmpeg4(void) av_cold void ff_msmpeg4_common_init(MpegEncContext *s) { - static int initialized=0; - switch(s->msmpeg4_version){ case 1: case 2: @@ -143,11 +145,7 @@ av_cold void ff_msmpeg4_common_init(MpegEncContext *s) } //Note the default tables are set in common_init in mpegvideo.c - if(!initialized){ - initialized=1; - - init_h263_dc_for_msmpeg4(); - } + init_h263_dc_for_msmpeg4(); } /* predict coded block */ @@ -229,13 +227,13 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, "addl %%eax, %2 \n\t" "addl %%eax, %1 \n\t" "addl %0, %%eax \n\t" - "mull %4 \n\t" + "imull %4 \n\t" "movl %%edx, %0 \n\t" "movl %1, %%eax \n\t" - "mull %4 \n\t" + "imull %4 \n\t" "movl %%edx, %1 \n\t" "movl %2, %%eax \n\t" - "mull %4 \n\t" + "imull %4 \n\t" "movl %%edx, %2 \n\t" : "+b" (a), "+c" (b), "+D" (c) : "g" (scale), "S" (ff_inverse[scale]) |