[FFmpeg-devel] [PATCH] Escape 124 (RPL) decoder rev4

Michael Niedermayer michaelni
Sun Mar 30 01:38:26 CET 2008


On Sat, Mar 29, 2008 at 03:47:12PM -0700, Eli Friedman wrote:
> Per subject, fourth revision of Escape 124 decoder.

[...]
> +static void insert_mb_into_sb(SuperBlock* sb, MacroBlock mb, unsigned index) {
> +   // Formula: ((index / 4) * 16 + (index % 4) * 2) / 2
> +   unsigned base = index + (index & -4);
> +   uint32_t *dst = sb->pixels32;
> +
> +   // This technically violates C99 aliasing rules, but it should be safe.
> +   dst[base  ] = mb.pixels32[0];
> +   dst[base+4] = mb.pixels32[1];
> +}

you dont need 2 variables to hold the index


[...]
> +            read_superblock_from_buffer(old_frame_data, old_stride,
> +                                        superblock_row_index,
> +                                        superblock_col_index, &sb);
> +            write_superblock_to_buffer(new_frame_data, new_stride,
> +                                       superblock_row_index,
> +                                       superblock_col_index, &sb);

This copies them twice, its better than the 4 time copy it was but still.



[...]
-- 
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: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080330/2d6d744f/attachment.pgp>



More information about the ffmpeg-devel mailing list