Merge commit '443502aed8b814d883825e52e91e4f018955aa66'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 11 Nov 2014 22:06:44 +0000 (23:06 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 11 Nov 2014 22:08:55 +0000 (23:08 +0100)
* commit '443502aed8b814d883825e52e91e4f018955aa66':
  dvbsubdec: move shared codepath

Conflicts:
libavcodec/dvbsubdec.c

The merged code is ignored and the factorization redone with
the code that is in FFmpeg.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/dvbsubdec.c

@@@ -727,28 -693,19 +727,20 @@@ static int dvbsub_read_8bit_string(uint
                  if (run_length == 0) {
                      return pixels_read;
                  }
 -
 -                if (non_mod == 1 && bits == 1)
 -                    pixels_read += run_length;
 +
++                bits = 0;
+             } else {
+                 bits = *(*srcbuf)++;
 -            if (map_table)
 -                bits = map_table[0];
 -            else
 -                bits = 0;
 -            while (run_length-- > 0 && pixels_read < dbuf_len) {
 -                *destbuf++ = bits;
 -                pixels_read++;
+             }
-                     bits = map_table[0];
-                 else
-                     bits = 0;
++            if (non_mod == 1 && bits == 1)
++                pixels_read += run_length;
++            else {
 +                if (map_table)
-             } else {
-                 bits = *(*srcbuf)++;
-                 if (non_mod == 1 && bits == 1)
-                     pixels_read += run_length;
-                 else {
-                     if (map_table)
-                         bits = map_table[bits];
-                     while (run_length-- > 0 && pixels_read < dbuf_len) {
-                         *destbuf++ = bits;
-                         pixels_read++;
-                     }
-                 }
++                    bits = map_table[bits];
 +                while (run_length-- > 0 && pixels_read < dbuf_len) {
 +                    *destbuf++ = bits;
 +                    pixels_read++;
 +                }
              }
          }
      }