[FFmpeg-cvslog] indeo4: handle frame type 1 properly

Kostya Shishkov git at videolan.org
Sat Jun 9 20:33:48 CEST 2012


ffmpeg | branch: master | Kostya Shishkov <kostya.shishkov at gmail.com> | Wed Jun  6 20:13:07 2012 +0200| [e1a3fa5d3ae63058fa2cf6dfcfaad50a8f61a034] | committer: Kostya Shishkov

indeo4: handle frame type 1 properly

It turns out that this frame type is actually intra and should be used as
a reference for interframes too.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1a3fa5d3ae63058fa2cf6dfcfaad50a8f61a034
---

 libavcodec/indeo4.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index c8ee0be..b4e14f6 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -40,7 +40,7 @@
  */
 enum {
     FRAMETYPE_INTRA       = 0,
-    FRAMETYPE_BIDIR1      = 1,  ///< bidirectional frame
+    FRAMETYPE_INTRA1      = 1,  ///< intra frame with slightly different bitstream coding
     FRAMETYPE_INTER       = 2,  ///< non-droppable P-frame
     FRAMETYPE_BIDIR       = 3,  ///< bidirectional frame
     FRAMETYPE_INTER_NOREF = 4,  ///< droppable P-frame
@@ -133,8 +133,7 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
     }
 
 #if IVI4_STREAM_ANALYSER
-    if (   ctx->frame_type == FRAMETYPE_BIDIR1
-        || ctx->frame_type == FRAMETYPE_BIDIR)
+    if (ctx->frame_type == FRAMETYPE_BIDIR)
         ctx->has_b_frames = 1;
 #endif
 
@@ -471,7 +470,8 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
             } else {
                 if (band->inherit_mv) {
                     mb->type = ref_mb->type; /* copy mb_type from corresponding reference mb */
-                } else if (ctx->frame_type == FRAMETYPE_INTRA) {
+                } else if (ctx->frame_type == FRAMETYPE_INTRA ||
+                           ctx->frame_type == FRAMETYPE_INTRA1) {
                     mb->type = 0; /* mb_type is always INTRA for intra-frames */
                 } else {
                     mb->type = get_bits(&ctx->gb, mb_type_bits);
@@ -539,6 +539,7 @@ static void switch_buffers(IVI45DecContext *ctx)
 {
     switch (ctx->prev_frame_type) {
     case FRAMETYPE_INTRA:
+    case FRAMETYPE_INTRA1:
     case FRAMETYPE_INTER:
         ctx->buf_switch ^= 1;
         ctx->dst_buf     = ctx->buf_switch;
@@ -550,6 +551,7 @@ static void switch_buffers(IVI45DecContext *ctx)
 
     switch (ctx->frame_type) {
     case FRAMETYPE_INTRA:
+    case FRAMETYPE_INTRA1:
         ctx->buf_switch = 0;
         /* FALLTHROUGH */
     case FRAMETYPE_INTER:



More information about the ffmpeg-cvslog mailing list