comparison wmv2.c @ 5887:83ac4620c6ed libavcodec

intrax8 decoder patch by "someone"
author michael
date Fri, 09 Nov 2007 21:37:48 +0000
parents 02007962faf4
children b47573cb7401
comparison
equal deleted inserted replaced
5886:85c4aca68be3 5887:83ac4620c6ed
27 #include "dsputil.h" 27 #include "dsputil.h"
28 #include "mpegvideo.h" 28 #include "mpegvideo.h"
29 #include "msmpeg4.h" 29 #include "msmpeg4.h"
30 #include "msmpeg4data.h" 30 #include "msmpeg4data.h"
31 #include "simple_idct.h" 31 #include "simple_idct.h"
32 #include "intrax8.h"
32 33
33 #define SKIP_TYPE_NONE 0 34 #define SKIP_TYPE_NONE 0
34 #define SKIP_TYPE_MPEG 1 35 #define SKIP_TYPE_MPEG 1
35 #define SKIP_TYPE_ROW 2 36 #define SKIP_TYPE_ROW 2
36 #define SKIP_TYPE_COL 3 37 #define SKIP_TYPE_COL 3
37 38
38 39
39 typedef struct Wmv2Context{ 40 typedef struct Wmv2Context{
40 MpegEncContext s; 41 MpegEncContext s;
42 IntraX8Context x8;
41 int j_type_bit; 43 int j_type_bit;
42 int j_type; 44 int j_type;
43 int abt_flag; 45 int abt_flag;
44 int abt_type; 46 int abt_type;
45 int abt_type_table[6]; 47 int abt_type_table[6];
470 s->esc3_run_length= 0; 472 s->esc3_run_length= 0;
471 473
472 s->picture_number++; //FIXME ? 474 s->picture_number++; //FIXME ?
473 475
474 476
475 // if(w->j_type)
476 // return wmv2_decode_j_picture(w); //FIXME
477
478 if(w->j_type){ 477 if(w->j_type){
479 av_log(s->avctx, AV_LOG_ERROR, "J-type picture is not supported\n"); 478 ff_intrax8_decode_picture(&w->x8, 2*s->qscale, (s->qscale-1)|1 );
480 return -1; 479 return 1;
481 } 480 }
482 481
483 return 0; 482 return 0;
484 } 483 }
485 484
828 } 827 }
829 828
830 static int wmv2_decode_init(AVCodecContext *avctx){ 829 static int wmv2_decode_init(AVCodecContext *avctx){
831 Wmv2Context * const w= avctx->priv_data; 830 Wmv2Context * const w= avctx->priv_data;
832 831
832 if(avctx->idct_algo==FF_IDCT_AUTO){
833 avctx->idct_algo=FF_IDCT_WMV2;
834 }
835
833 if(ff_h263_decode_init(avctx) < 0) 836 if(ff_h263_decode_init(avctx) < 0)
834 return -1; 837 return -1;
835 838
836 wmv2_common_init(w); 839 wmv2_common_init(w);
840
841 ff_intrax8_common_init(&w->x8,&w->s);
837 842
838 return 0; 843 return 0;
839 } 844 }
840 845
841 #ifdef CONFIG_WMV2_DECODER 846 #ifdef CONFIG_WMV2_DECODER