[FFmpeg-cvslog] Merge commit 'b53d8c3ccfeff77874f5ca7c68136b6d87a0a69c'

Clément Bœsch git at videolan.org
Sun Mar 19 17:04:37 EET 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sun Mar 19 16:03:25 2017 +0100| [1a48a51bfcd0c8b1fd22ae6a8ad5b1e26bec5bee] | committer: Clément Bœsch

Merge commit 'b53d8c3ccfeff77874f5ca7c68136b6d87a0a69c'

* commit 'b53d8c3ccfeff77874f5ca7c68136b6d87a0a69c':
  mjpegdec: Drop disabled code

The last chunk is replaced with a comment describing the structure.

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a48a51bfcd0c8b1fd22ae6a8ad5b1e26bec5bee
---

 libavcodec/mjpegdec.c | 28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 4e78e1e..8bf2fdf 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1665,17 +1665,9 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
             s->buggy_avid = 1;
         i = get_bits(&s->gb, 8); len--;
         av_log(s->avctx, AV_LOG_DEBUG, "polarity %d\n", i);
-#if 0
-        skip_bits(&s->gb, 8);
-        skip_bits(&s->gb, 32);
-        skip_bits(&s->gb, 32);
-        len -= 10;
-#endif
         goto out;
     }
 
-//    len -= 2;
-
     if (id == AV_RB32("JFIF")) {
         int t_w, t_h, v1, v2;
         if (len < 8)
@@ -1859,16 +1851,16 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
         len -= 4;
         /* Apple MJPEG-A */
         if (id == AV_RB32("mjpg")) {
-#if 0
-            skip_bits(&s->gb, 32); /* field size */
-            skip_bits(&s->gb, 32); /* pad field size */
-            skip_bits(&s->gb, 32); /* next off */
-            skip_bits(&s->gb, 32); /* quant off */
-            skip_bits(&s->gb, 32); /* huff off */
-            skip_bits(&s->gb, 32); /* image off */
-            skip_bits(&s->gb, 32); /* scan off */
-            skip_bits(&s->gb, 32); /* data off */
-#endif
+            /* structure:
+                4bytes      field size
+                4bytes      pad field size
+                4bytes      next off
+                4bytes      quant off
+                4bytes      huff off
+                4bytes      image off
+                4bytes      scan off
+                4bytes      data off
+            */
             if (s->avctx->debug & FF_DEBUG_PICT_INFO)
                 av_log(s->avctx, AV_LOG_INFO, "mjpeg: Apple MJPEG-A header found\n");
         }


======================================================================

diff --cc libavcodec/mjpegdec.c
index 4e78e1e,c670f35..8bf2fdf
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@@ -1662,24 -1209,17 +1662,16 @@@ static int mjpeg_decode_app(MJpegDecode
              4bytes      field_size
              4bytes      field_size_less_padding
          */
 -        s->buggy_avid = 1;
 -        i = get_bits(&s->gb, 8);
 -        if (i == 2)
 -            s->bottom_field = 1;
 -        else if (i == 1)
 -            s->bottom_field = 0;
 +            s->buggy_avid = 1;
 +        i = get_bits(&s->gb, 8); len--;
 +        av_log(s->avctx, AV_LOG_DEBUG, "polarity %d\n", i);
- #if 0
-         skip_bits(&s->gb, 8);
-         skip_bits(&s->gb, 32);
-         skip_bits(&s->gb, 32);
-         len -= 10;
- #endif
          goto out;
      }
  
- //    len -= 2;
- 
 -    if (id == AV_RL32("JFIF")) {
 +    if (id == AV_RB32("JFIF")) {
          int t_w, t_h, v1, v2;
 +        if (len < 8)
 +            goto out;
          skip_bits(&s->gb, 8); /* the trailing zero-byte */
          v1 = get_bits(&s->gb, 8);
          v2 = get_bits(&s->gb, 8);
@@@ -1856,19 -1285,10 +1848,19 @@@
      /* Apple MJPEG-A */
      if ((s->start_code == APP1) && (len > (0x28 - 8))) {
          id   = get_bits_long(&s->gb, 32);
 -        id   = av_be2ne32(id);
          len -= 4;
          /* Apple MJPEG-A */
 -        if (id == AV_RL32("mjpg")) {
 +        if (id == AV_RB32("mjpg")) {
- #if 0
-             skip_bits(&s->gb, 32); /* field size */
-             skip_bits(&s->gb, 32); /* pad field size */
-             skip_bits(&s->gb, 32); /* next off */
-             skip_bits(&s->gb, 32); /* quant off */
-             skip_bits(&s->gb, 32); /* huff off */
-             skip_bits(&s->gb, 32); /* image off */
-             skip_bits(&s->gb, 32); /* scan off */
-             skip_bits(&s->gb, 32); /* data off */
- #endif
++            /* structure:
++                4bytes      field size
++                4bytes      pad field size
++                4bytes      next off
++                4bytes      quant off
++                4bytes      huff off
++                4bytes      image off
++                4bytes      scan off
++                4bytes      data off
++            */
              if (s->avctx->debug & FF_DEBUG_PICT_INFO)
                  av_log(s->avctx, AV_LOG_INFO, "mjpeg: Apple MJPEG-A header found\n");
          }



More information about the ffmpeg-cvslog mailing list