changeset 646:f87dc45d921d libavcodec

fixing rv10 encoding (ffmpeg can at least decode its own rv10 files now)
author michaelni
date Thu, 05 Sep 2002 13:23:11 +0000
parents f53e17dec13f
children 22b22723805e
files rv10.c
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rv10.c	Thu Sep 05 10:06:20 2002 +0000
+++ b/rv10.c	Thu Sep 05 13:23:11 2002 +0000
@@ -223,8 +223,18 @@
 /* write RV 1.0 compatible frame header */
 void rv10_encode_picture_header(MpegEncContext *s, int picture_number)
 {
+    int full_frame= 1;
+
     align_put_bits(&s->pb);
+    
+    if(full_frame){
+        put_bits(&s->pb, 8, 0xc0);	/* packet header */
+        put_bits(&s->pb, 16, 0x4000);	/* len */
+        put_bits(&s->pb, 16, 0x4000);	/* pos */
+    }
 
+    put_bits(&s->pb, 8, picture_number&0xFF);
+    
     put_bits(&s->pb, 1, 1);	/* marker */
 
     put_bits(&s->pb, 1, (s->pict_type == P_TYPE));
@@ -238,9 +248,11 @@
     }
     /* if multiple packets per frame are sent, the position at which
        to display the macro blocks is coded here */
-    put_bits(&s->pb, 6, 0);	/* mb_x */
-    put_bits(&s->pb, 6, 0);	/* mb_y */
-    put_bits(&s->pb, 12, s->mb_width * s->mb_height);
+    if(!full_frame){
+        put_bits(&s->pb, 6, 0);	/* mb_x */
+        put_bits(&s->pb, 6, 0);	/* mb_y */
+        put_bits(&s->pb, 12, s->mb_width * s->mb_height);
+    }
 
     put_bits(&s->pb, 3, 0);	/* ignored */
 }