[FFmpeg-devel] [Read EXIF metadata 1/3] Refactor TIFF tag related functions to share the code.

Michael Niedermayer michaelni at gmx.at
Fri Aug 9 15:00:34 CEST 2013


On Mon, Aug 05, 2013 at 05:33:24PM +0200, Thilo Borgmann wrote:
> 1/3 rev 2
> 
> -Thilo

>  Makefile      |    2 
>  tiff.c        |  245 ++++++-------------------------------------------------
>  tiff.h        |   22 ----
>  tiff_common.c |  257 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tiff_common.h |  114 +++++++++++++++++++++++++
>  5 files changed, 403 insertions(+), 237 deletions(-)
> ea1fe1fdb017d5c97b64040a3666082ca701b295  0001-Refactor-TIFF-tag-related-functions-to-share-the-cod.patch
> From ac3ffda55727de2dc6ad1d79fd49111b769c6258 Mon Sep 17 00:00:00 2001
> From: Thilo Borgmann <thilo.borgmann at googlemail.com>
> Date: Mon, 5 Aug 2013 17:24:28 +0200
> Subject: [PATCH 1/3] Refactor TIFF tag related functions to share the code.
[...]
> @@ -702,42 +546,29 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
>      uint32_t *pal;
>      double *dp;
>  
> -    tag   = tget_short(&s->gb, s->le);
> -    type  = tget_short(&s->gb, s->le);
> -    count = tget_long(&s->gb, s->le);
> -    off   = tget_long(&s->gb, s->le);
> -    start = bytestream2_tell(&s->gb);
> -
> -    if (type == 0 || type >= FF_ARRAY_ELEMS(type_sizes)) {
> -        av_log(s->avctx, AV_LOG_DEBUG, "Unknown tiff type (%u) encountered\n",
> -               type);
> +    ret = ff_tread_tag(s->avctx, &s->gb, s->le, &tag, &type, &count, &start);
> +    if (ret < 0) {
>          return 0;
>      }
>  
> +    if (count <= 4 && (type_sizes[type] * (count) <= 4 || type == TIFF_STRING)) {
> +        off = ff_tget_long(&s->gb, s->le);
> +        bytestream2_seek(&s->gb, -4, SEEK_CUR);
> +    }

ive removed the -4 seek from tiff
please update your patch

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130809/0ef069ab/attachment.asc>


More information about the ffmpeg-devel mailing list