[FFmpeg-devel] Indeo3 replacement, take 3
Vitor Sessak
vitor1001
Fri Oct 30 01:03:23 CET 2009
Maxim wrote:
> Hello crews,
>
> attached a new version of my indeo3 decoder replacing the existing one
> from the FFmpeg's svn.
Nice!
> Below the changes in short:
>
> - further code merging and simplifications pointed by Reimer
> - mode 10 operates with int64_t deltas now
> - some alignments were added
> - AV_RN* were replaced with casts
> - tested on PPC, both 32 and 64 bits and works so far
>
> Issues I wasn't able to fix:
>
> - after compiling with the last svn version ffmpeg shows the error
> message saying "Found 1 unreleased buffers". I ensured that each
> av_malloc has a corresponding av_free call. My decoder uses dsputils as
> well. Does it allocate some memory?
It is probably missing something like
> if (ctx->frame.data[0])
> avctx->release_buffer(avctx, &ctx->frame);
in free_frame_buffers()
> - compiling with AltiVec enabled on my PPC G5 produces wrong checksums
> on delta frames. A brief check has shown that "copy_cell" function using
> DSP util's dsp.put_no_rnd_pixels_tab[0][0]" and
> dsp.put_no_rnd_pixels_tab[1][0] causes that problem. It just works fine
> with AltiVec disabled. Could someone skilled in the art help me with it?
I have a guess:
Your code does:
> luma_pitch = FFALIGN(luma_width, 8);
> chroma_pitch = FFALIGN(chroma_width, 8);
[...]
> ctx->planes[p].pitch = (!p ? luma_pitch : chroma_pitch);
> ctx->planes[p].width = (!p ? luma_width : chroma_width);
> ctx->planes[p].height = (!p ? luma_height : chroma_height);
[...]
>
> /* copy using 16xH blocks */
> for (i = cell->width >> 2; i > 0; src += 16, dst += 16, i--)
> ctx->dsp.put_no_rnd_pixels_tab[0][0](dst, src, plane->pitch, h);
And ppc/dsputils_altivec.c says
> /* next one assumes that ((line_size % 16) == 0) */
> void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
> {
[...]
> c->put_pixels_tab[0][0] = put_pixels16_altivec;
So this should be the culprit. Just align to 16 instead of 8.
-Vitor
More information about the ffmpeg-devel
mailing list