aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-05-16 22:01:30 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-05-16 22:01:30 +0000
commit02734c6a3eff370de9f5eafb37944348b5d4ce1c (patch)
tree315f11fa7d23eff1300f471a798c6c90145356fe /libavcodec/h263dec.c
parent83286d2a750fa45f52f401ea83600d98530e8389 (diff)
downloadffmpeg-02734c6a3eff370de9f5eafb37944348b5d4ce1c.tar.gz
print frame decoding time support (x86 only)
Originally committed as revision 504 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index b18753b0da..ac882a06a4 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -24,6 +24,18 @@
#include "mpegvideo.h"
//#define DEBUG
+//#define PRINT_FRAME_TIME
+#ifdef PRINT_FRAME_TIME
+static inline long long rdtsc()
+{
+ long long l;
+ asm volatile( "rdtsc\n\t"
+ : "=A" (l)
+ );
+// printf("%d\n", int(l/1000));
+ return l;
+}
+#endif
static int h263_decode_init(AVCodecContext *avctx)
{
@@ -103,7 +115,9 @@ static int h263_decode_frame(AVCodecContext *avctx,
MpegEncContext *s = avctx->priv_data;
int ret;
AVPicture *pict = data;
-
+#ifdef PRINT_FRAME_TIME
+uint64_t time= rdtsc();
+#endif
#ifdef DEBUG
printf("*****frame %d size=%d\n", avctx->frame_number, buf_size);
printf("bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
@@ -317,7 +331,9 @@ static int h263_decode_frame(AVCodecContext *avctx,
note we allready added +1 for the current pix in MPV_frame_end(s) */
if(s->num_available_buffers>=2 || (!s->has_b_frames))
*data_size = sizeof(AVPicture);
-
+#ifdef PRINT_FRAME_TIME
+printf("%Ld\n", rdtsc()-time);
+#endif
return buf_size;
}