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
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
|