From: Matthieu Bouron <matthieu.bou...@stupeflix.com>

---

Hello,

The following patch disable parsing if the frame_size option is specified. The
main purpose here is to disable the use of parsers (which have a huge
performance cost on embedded platforms) for single images when
their size is known in advance.

The patch sounds hackish to me though, but others might consider it OK (or not).

The performance of the jpeg parser still need to be addressed at some point.

Matthieu

---
 libavformat/img2dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index fe0e346..9aa6dd7 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -206,7 +206,7 @@ int ff_img_read_header(AVFormatContext *s1)
         s->is_pipe = 0;
     else {
         s->is_pipe       = 1;
-        st->need_parsing = AVSTREAM_PARSE_FULL;
+        st->need_parsing = s->frame_size > 0 ? AVSTREAM_PARSE_NONE : 
AVSTREAM_PARSE_FULL;
     }
 
     if (s->ts_from_file == 2) {
-- 
2.7.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to