comparison h263dec.c @ 384:d442918c4698 libavcodec

print frame decoding time support (x86 only)
author michaelni
date Thu, 16 May 2002 22:01:30 +0000
parents dc2fb310008d
children fce0a2520551
comparison
equal deleted inserted replaced
383:e6b64bc3bc87 384:d442918c4698
22 #include "dsputil.h" 22 #include "dsputil.h"
23 #include "avcodec.h" 23 #include "avcodec.h"
24 #include "mpegvideo.h" 24 #include "mpegvideo.h"
25 25
26 //#define DEBUG 26 //#define DEBUG
27 //#define PRINT_FRAME_TIME
28 #ifdef PRINT_FRAME_TIME
29 static inline long long rdtsc()
30 {
31 long long l;
32 asm volatile( "rdtsc\n\t"
33 : "=A" (l)
34 );
35 // printf("%d\n", int(l/1000));
36 return l;
37 }
38 #endif
27 39
28 static int h263_decode_init(AVCodecContext *avctx) 40 static int h263_decode_init(AVCodecContext *avctx)
29 { 41 {
30 MpegEncContext *s = avctx->priv_data; 42 MpegEncContext *s = avctx->priv_data;
31 43
101 UINT8 *buf, int buf_size) 113 UINT8 *buf, int buf_size)
102 { 114 {
103 MpegEncContext *s = avctx->priv_data; 115 MpegEncContext *s = avctx->priv_data;
104 int ret; 116 int ret;
105 AVPicture *pict = data; 117 AVPicture *pict = data;
106 118 #ifdef PRINT_FRAME_TIME
119 uint64_t time= rdtsc();
120 #endif
107 #ifdef DEBUG 121 #ifdef DEBUG
108 printf("*****frame %d size=%d\n", avctx->frame_number, buf_size); 122 printf("*****frame %d size=%d\n", avctx->frame_number, buf_size);
109 printf("bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]); 123 printf("bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
110 #endif 124 #endif
111 125
315 329
316 /* dont output the last pic after seeking 330 /* dont output the last pic after seeking
317 note we allready added +1 for the current pix in MPV_frame_end(s) */ 331 note we allready added +1 for the current pix in MPV_frame_end(s) */
318 if(s->num_available_buffers>=2 || (!s->has_b_frames)) 332 if(s->num_available_buffers>=2 || (!s->has_b_frames))
319 *data_size = sizeof(AVPicture); 333 *data_size = sizeof(AVPicture);
320 334 #ifdef PRINT_FRAME_TIME
335 printf("%Ld\n", rdtsc()-time);
336 #endif
321 return buf_size; 337 return buf_size;
322 } 338 }
323 339
324 AVCodec mpeg4_decoder = { 340 AVCodec mpeg4_decoder = {
325 "mpeg4", 341 "mpeg4",