[FFmpeg-devel] [PATCH 2/4] targa: support 2-way and 4-way interleaved files
Michael Niedermayer
michaelni at gmx.at
Mon Oct 8 23:32:14 CEST 2012
On Mon, Oct 08, 2012 at 12:41:19AM -0500, Bobby Bingham wrote:
> Fixes ticket #701
>
> Signed-off-by: Bobby Bingham <uhmmmm at gmail.com>
> ---
> libavcodec/targa.c | 76 +++++++++++++++++++++++++++++++++++-------------------
> libavcodec/targa.h | 4 ++-
> 2 files changed, 53 insertions(+), 27 deletions(-)
>
> diff --git a/libavcodec/targa.c b/libavcodec/targa.c
> index e3d917e..68f6577 100644
> --- a/libavcodec/targa.c
> +++ b/libavcodec/targa.c
> @@ -33,17 +33,35 @@ typedef struct TargaContext {
> int compression_type;
> } TargaContext;
>
> +static uint8_t *advance_line(uint8_t *start, uint8_t *line,
> + int stride, int *y, int h, int interleave)
> +{
> + *y += interleave;
> +
> + if (*y < h) {
> + return line + interleave * stride;
> + } else {
> + *y = (*y + 1) & (interleave - 1);
> + if (*y) {
> + return start + *y * stride;
> + } else {
> + return NULL;
> + }
> + }
> +}
> +
> static int targa_decode_rle(AVCodecContext *avctx, TargaContext *s,
> - uint8_t *dst, int w, int h, int stride, int bpp)
> + uint8_t *dst, int w, int h, int stride,
> + int bpp, int interleave)
> {
> int x, y;
> int depth = (bpp + 1) >> 3;
> int type, count;
> - int diff;
> + uint8_t *line = dst;
> + uint8_t *cur = line;
i would suggest
s/dst/start/ or dst_start
s/cur/dst/
this should reduce the diff
excapt that nitpick, LGTM
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- 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/20121008/dd7580a9/attachment.asc>
More information about the ffmpeg-devel
mailing list