New submission from jcoalson <[EMAIL PROTECTED]>:

this is a patch to the flac decoder to support bitstream additions in 1.2.0

the first is the new 'blocking strategy' bit which is the 16th bit of the frame
header, see
http://flac.sourceforge.net/format.html#frame_header

the second is the new RICE2 entropy coding method, which is simply RICE with a
5-bit rice parameter:
http://flac.sourceforge.net/format.html#residual

----------
files: ffmpeg-flac-1.2.x.patch
messages: 663
nosy: jcoalson
priority: important
status: new
substatus: new
title: patch to support new FLAC features
type: patch

______________________________________________________
FFmpeg issue tracker <[EMAIL PROTECTED]>
<https://roundup.mplayerhq.hu/roundup/ffmpeg/issue186>
______________________________________________________
Index: flac.c
===================================================================
--- flac.c	(revision 10559)
+++ flac.c	(working copy)
@@ -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);
@@ -609,9 +609,9 @@
     if (!metadata_parse(s))
     {
         tmp = show_bits(&s->gb, 16);
-        if(tmp != 0xFFF8){
+        if(tmp & 0xFFFE != 0xFFF8){
             av_log(s->avctx, AV_LOG_ERROR, "FRAME HEADER not here\n");
-            while(get_bits_count(&s->gb)/8+2 < buf_size && show_bits(&s->gb, 16) != 0xFFF8)
+            while(get_bits_count(&s->gb)/8+2 < buf_size && show_bits(&s->gb, 16) & 0xFFFE != 0xFFF8)
                 skip_bits(&s->gb, 8);
             goto end; // we may not have enough bits left to decode a frame, so try next time
         }

Reply via email to