[FFmpeg-devel] [PATCH] Mimic decoder

Måns Rullgård mans
Wed Mar 12 02:25:52 CET 2008


M?ns Rullg?rd <mans at mansr.com> writes:

>>     /* Decode Cr and Cb planes. */
>>     for(chrom_ch = 0; chrom_ch < 2; chrom_ch++) {
>>         base_src = (chrom_ch ? ctx->prev_frame.data[1] : ctx->prev_frame.data[2]);
>>         base_dst = (chrom_ch ? ctx->picture.data[1] : ctx->picture.data[2]);
>
> for (chrom_ch = 1; chrom_ch <= 2; chrom_ch++) {
>     base_dst = ctx->prev_frame.data[3-chrom_ch];

for (chrom_ch = 0; chrom_ch < 2; chrom_ch++) {
    base_dst = ctx->prev_frame.data[2-chrom_ch];

My first impulse was to use data[chrom_ch], before noticing the order
was swapped, hence the 1..2 range.  Subsequent lack of thought led to
the 3-.  I should make it a habit to review my reviews before posting.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list