summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-03-29 02:07:25 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-03-29 02:07:25 +0000
commit7f89b6fbdc6e5e2c2feee32093eb27ba775ea059 (patch)
tree1e427f30bd4ebb2447202c6e264112a7ac38558d /libavcodec
parentdbbe89994bb2771e17359487bda9c8cdf2215b75 (diff)
msmpeg4v2 header parser & some dump bits code behind #if 0
Originally committed as revision 368 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/msmpeg4.c58
1 files changed, 57 insertions, 1 deletions
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 88b4a7ae66..eeedca646b 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -670,7 +670,7 @@ static int decode012(GetBitContext *gb)
return get_bits1(gb) + 1;
}
-int msmpeg4_decode_picture_header(MpegEncContext * s)
+int msmpeg4v2_decode_picture_header(MpegEncContext * s)
{
int code;
@@ -689,6 +689,62 @@ int msmpeg4_decode_picture_header(MpegEncContext * s)
if (code < 0x17)
return -1;
s->slice_height = s->mb_height / (code - 0x16);
+/* s->rl_chroma_table_index = decode012(&s->gb);
+ s->rl_table_index = decode012(&s->gb);
+
+ s->dc_table_index = get_bits1(&s->gb);*/
+ s->no_rounding = 1;
+ } else {
+ s->use_skip_mb_code = get_bits1(&s->gb);
+
+/* s->rl_table_index = decode012(&s->gb);
+ s->rl_chroma_table_index = s->rl_table_index;
+
+ s->dc_table_index = get_bits1(&s->gb);
+
+ s->mv_table_index = get_bits1(&s->gb);*/
+ if(s->flipflop_rounding){
+ s->no_rounding ^= 1;
+ }else{
+ s->no_rounding = 0;
+ }
+// printf("%d", s->no_rounding);
+ }
+
+printf("%s q:%d s:%X ", s->pict_type == I_TYPE ? "I" : "P" , s->qscale,
+ s->pict_type == I_TYPE ? code : s->use_skip_mb_code);
+
+ return 0;
+}
+
+int msmpeg4_decode_picture_header(MpegEncContext * s)
+{
+ int code;
+#if 0
+{
+int i;
+msmpeg4v2_decode_picture_header(s);
+for(i=0; i<s->gb.size*8; i++)
+ printf("%d", get_bits1(&s->gb));
+printf("END\n");
+return -1;
+}
+#endif
+ s->pict_type = get_bits(&s->gb, 2) + 1;
+ if (s->pict_type != I_TYPE &&
+ s->pict_type != P_TYPE)
+ return -1;
+
+ s->qscale = get_bits(&s->gb, 5);
+
+ if (s->pict_type == I_TYPE) {
+ code = get_bits(&s->gb, 5);
+ /* 0x17: one slice, 0x18: three slices */
+ /* XXX: implement it */
+ //printf("%d %d %d\n", code, s->slice_height, s->first_slice_line);
+ if (code < 0x17)
+ return -1;
+ s->slice_height = s->mb_height / (code - 0x16);
s->rl_chroma_table_index = decode012(&s->gb);
s->rl_table_index = decode012(&s->gb);