comparison h263dec.c @ 1586:3d1d0490e5a6 libavcodec

pts fix and related fixes
author michael
date Thu, 30 Oct 2003 16:58:49 +0000
parents dd544554ed42
children 932d306bf1dc
comparison
equal deleted inserted replaced
1585:6b224ca24033 1586:3d1d0490e5a6
26 #include "dsputil.h" 26 #include "dsputil.h"
27 #include "mpegvideo.h" 27 #include "mpegvideo.h"
28 28
29 //#define DEBUG 29 //#define DEBUG
30 //#define PRINT_FRAME_TIME 30 //#define PRINT_FRAME_TIME
31 #ifdef PRINT_FRAME_TIME
32 static inline long long rdtsc()
33 {
34 long long l;
35 asm volatile( "rdtsc\n\t"
36 : "=A" (l)
37 );
38 // printf("%d\n", int(l/1000));
39 return l;
40 }
41 #endif
42 31
43 int ff_h263_decode_init(AVCodecContext *avctx) 32 int ff_h263_decode_init(AVCodecContext *avctx)
44 { 33 {
45 MpegEncContext *s = avctx->priv_data; 34 MpegEncContext *s = avctx->priv_data;
46 35
444 433
445 if (!s->context_initialized) { 434 if (!s->context_initialized) {
446 if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix 435 if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
447 return -1; 436 return -1;
448 } 437 }
438
439 //we need to set current_picture_ptr before reading the header, otherwise we cant store anyting im there
440 if(s->current_picture_ptr==NULL || s->current_picture_ptr->data[0]){
441 int i= ff_find_unused_picture(s, 0);
442 s->current_picture_ptr= &s->picture[i];
443 }
449 444
450 /* let's go :-) */ 445 /* let's go :-) */
451 if (s->msmpeg4_version==5) { 446 if (s->msmpeg4_version==5) {
452 ret= ff_wmv2_decode_picture_header(s); 447 ret= ff_wmv2_decode_picture_header(s);
453 } else if (s->msmpeg4_version) { 448 } else if (s->msmpeg4_version) {