1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-07-16 22:42:38 +02:00

lagarith: Add correct line prediction for RGB

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Nathan Caldwell
2011-11-16 00:45:00 -07:00
committed by Martin Storsjö
parent 52767d891c
commit 39616fc307

View File

@ -245,21 +245,21 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf,
{ {
int L, TL; int L, TL;
/* Left pixel is actually prev_row[width] */
L = buf[width - stride - 1];
if (!line) { if (!line) {
/* Left prediction only for first line */ /* Left prediction only for first line */
L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1, L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1,
width - 1, buf[0]); width - 1, buf[0]);
return; return;
} else if (line == 1) { } else if (line == 1) {
/* Second line, left predict first pixel, the rest of the line is median predicted */ /* Second line, left predict first pixel, the rest of the line is median predicted
/* FIXME: In the case of RGB this pixel is top predicted */ * NOTE: In the case of RGB this pixel is top predicted */
TL = buf[-stride]; TL = l->avctx->pix_fmt == PIX_FMT_YUV420P ? buf[-stride] : L;
} else { } else {
/* Top left is 2 rows back, last pixel */ /* Top left is 2 rows back, last pixel */
TL = buf[width - (2 * stride) - 1]; TL = buf[width - (2 * stride) - 1];
} }
/* Left pixel is actually prev_row[width] */
L = buf[width - stride - 1];
add_lag_median_prediction(buf, buf - stride, buf, add_lag_median_prediction(buf, buf - stride, buf,
width, &L, &TL); width, &L, &TL);