diff flac.c @ 5871:83554c0e9ce6 libavcodec

Add support for FLAC's new RICE2 entropy coding method. Patch by Josh Coalson.
author jbr
date Sat, 03 Nov 2007 23:54:50 +0000
parents 154b02065699
children cd4b72a32517
line wrap: on
line diff
--- a/flac.c	Sat Nov 03 22:37:18 2007 +0000
+++ b/flac.c	Sat Nov 03 23:54:50 2007 +0000
@@ -217,7 +217,7 @@
     int sample = 0, samples;
 
     method_type = get_bits(&s->gb, 2);
-    if (method_type != 0){
+    if (method_type > 1){
         av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type);
         return -1;
     }
@@ -234,8 +234,8 @@
     i= pred_order;
     for (partition = 0; partition < (1 << rice_order); partition++)
     {
-        tmp = get_bits(&s->gb, 4);
-        if (tmp == 15)
+        tmp = get_bits(&s->gb, method_type == 0 ? 4 : 5);
+        if (tmp == (method_type == 0 ? 15 : 31))
         {
             av_log(s->avctx, AV_LOG_DEBUG, "fixed len partition\n");
             tmp = get_bits(&s->gb, 5);