changeset 2047:541686b38a5e libavcodec

removing h263 specific code
author michael
date Sun, 30 May 2004 22:29:15 +0000
parents 863ce5459aec
children 533717e2910f
files h261.c
diffstat 1 files changed, 5 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/h261.c	Sun May 30 21:39:38 2004 +0000
+++ b/h261.c	Sun May 30 22:29:15 2004 +0000
@@ -662,9 +662,6 @@
     int ret;
     AVFrame *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]);
@@ -674,13 +671,6 @@
 
     /* no supplementary picture */
     if (buf_size == 0) {
-        /* special case for last picture */
-        if (s->low_delay==0 && s->next_picture_ptr) {
-            *pict= *(AVFrame*)s->next_picture_ptr;
-            s->next_picture_ptr= NULL;
-
-            *data_size = sizeof(AVFrame);
-        }
 
         return 0;
     }
@@ -697,11 +687,7 @@
 
 retry:
 
-    if(s->bitstream_buffer_size && buf_size<20){
-        init_get_bits(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size*8);
-    }else
-        init_get_bits(&s->gb, buf, buf_size*8);
-    s->bitstream_buffer_size=0;
+    init_get_bits(&s->gb, buf, buf_size*8);
 
     if(!s->context_initialized){
         if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
@@ -716,8 +702,6 @@
 
     ret = h261_decode_picture_header(h);
 
-    if(ret==FRAME_SKIPED) return get_consumed_bytes(s, buf_size);
-
     /* skip if the header was thrashed */
     if (ret < 0){
         av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
@@ -776,27 +760,16 @@
 
 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
 assert(s->current_picture.pict_type == s->pict_type);
-    if(s->low_delay){
-        *pict= *(AVFrame*)&s->current_picture;
-        ff_print_debug_info(s, pict);
-    }else{
-        *pict= *(AVFrame*)&s->last_picture;
-        if(pict)
-            ff_print_debug_info(s, pict);
-    }
+    *pict= *(AVFrame*)&s->current_picture;
+    ff_print_debug_info(s, pict);
 
     /* Return the Picture timestamp as the frame number */
     /* we substract 1 because it is added on utils.c    */
     avctx->frame_number = s->picture_number - 1;
 
-    /* dont output the last pic after seeking */
-    if(s->last_picture_ptr || s->low_delay)
-        *data_size = sizeof(AVFrame);
-#ifdef PRINT_FRAME_TIME
-printf("%Ld\n", rdtsc()-time);
-#endif
+    *data_size = sizeof(AVFrame);
 
-return get_consumed_bytes(s, buf_size);
+    return get_consumed_bytes(s, buf_size);
 }
 
 static int h261_decode_end(AVCodecContext *avctx)