mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-24 17:12:34 +02:00
print frame decoding time support (x86 only)
Originally committed as revision 504 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
83286d2a75
commit
02734c6a3e
@ -24,6 +24,18 @@
|
|||||||
#include "mpegvideo.h"
|
#include "mpegvideo.h"
|
||||||
|
|
||||||
//#define DEBUG
|
//#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)
|
static int h263_decode_init(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
@ -103,7 +115,9 @@ static int h263_decode_frame(AVCodecContext *avctx,
|
|||||||
MpegEncContext *s = avctx->priv_data;
|
MpegEncContext *s = avctx->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
AVPicture *pict = data;
|
AVPicture *pict = data;
|
||||||
|
#ifdef PRINT_FRAME_TIME
|
||||||
|
uint64_t time= rdtsc();
|
||||||
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("*****frame %d size=%d\n", avctx->frame_number, buf_size);
|
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]);
|
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) */
|
note we allready added +1 for the current pix in MPV_frame_end(s) */
|
||||||
if(s->num_available_buffers>=2 || (!s->has_b_frames))
|
if(s->num_available_buffers>=2 || (!s->has_b_frames))
|
||||||
*data_size = sizeof(AVPicture);
|
*data_size = sizeof(AVPicture);
|
||||||
|
#ifdef PRINT_FRAME_TIME
|
||||||
|
printf("%Ld\n", rdtsc()-time);
|
||||||
|
#endif
|
||||||
return buf_size;
|
return buf_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user