]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/img2dec.c
x86/hevc_deblock: remove some unnecessary instructions
[ffmpeg] / libavformat / img2dec.c
index 7e209eefa722ea24916ac58bfe5e4cb46117b43a..cf51c0bb096c47ff0008051cdda6dcea8e90c32d 100644 (file)
@@ -305,7 +305,7 @@ int ff_img_read_header(AVFormatContext *s1)
         s->split_planes       = str && !av_strcasecmp(str + 1, "y");
         st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
         if (s1->pb) {
-            int probe_buffer_size = 8;
+            int probe_buffer_size = 2048;
             uint8_t *probe_buffer = av_realloc(NULL, probe_buffer_size + AVPROBE_PADDING_SIZE);
             AVInputFormat *fmt = NULL;
             AVProbeData pd;
@@ -564,13 +564,20 @@ AVInputFormat ff_image2pipe_demuxer = {
 static int bmp_probe(AVProbeData *p)
 {
     const uint8_t *b = p->buf;
+    int ihsize;
 
-    if (AV_RB16(b) == 0x424d)
-        if (!AV_RN32(b + 6)) {
-            return AVPROBE_SCORE_EXTENSION + 1;
-        } else {
-            return AVPROBE_SCORE_EXTENSION / 4;
-        }
+    if (AV_RB16(b) != 0x424d)
+        return 0;
+
+    ihsize = AV_RL32(b+14);
+    if (ihsize < 12 || ihsize > 255)
+        return 0;
+
+    if (!AV_RN32(b + 6)) {
+        return AVPROBE_SCORE_EXTENSION + 1;
+    } else {
+        return AVPROBE_SCORE_EXTENSION / 4;
+    }
     return 0;
 }
 
@@ -645,7 +652,8 @@ static int tiff_probe(AVProbeData *p)
 {
     const uint8_t *b = p->buf;
 
-    if (AV_RB32(b) == 0x49492a00)
+    if (AV_RB32(b) == 0x49492a00 ||
+        AV_RB32(b) == 0x4D4D002a)
         return AVPROBE_SCORE_EXTENSION + 1;
     return 0;
 }
@@ -659,12 +667,11 @@ static const AVClass imgname ## _class = {\
 };\
 AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
     .name           = AV_STRINGIFY(imgname) "_pipe",\
+    .long_name      = NULL_IF_CONFIG_SMALL("piped " AV_STRINGIFY(imgname) " sequence"),\
     .priv_data_size = sizeof(VideoDemuxData),\
     .read_probe     = imgname ## _probe,\
     .read_header    = ff_img_read_header,\
     .read_packet    = ff_img_read_packet,\
-    .read_close     = img_read_close,\
-    .read_seek      = img_read_seek,\
     .priv_class     = & imgname ## _class,\
     .raw_codec_id   = codecid,\
 };