Unified · Split
| @@ -245,21 +245,21 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf, · 244 unmodified lines | ||
| 245 | 245 | { |
| 246 | 246 | int L, TL; |
| 247 | 247 | |
| 248 | + /* Left pixel is actually prev_row[width] */ | |
| 249 | + L = buf[width - stride - 1]; | |
| 248 | 250 | if (!line) { |
| 249 | 251 | /* Left prediction only for first line */ |
| 250 | 252 | L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1, |
| 251 | 253 | width - 1, buf[0]); |
| 252 | 254 | return; |
| 253 | 255 | } else if (line == 1) { |
| 254 | − /* Second line, left predict first pixel, the rest of the line is median predicted */ | |
| 255 | − /* FIXME: In the case of RGB this pixel is top predicted */ | |
| 256 | − TL = buf[-stride]; | |
| 256 | + /* Second line, left predict first pixel, the rest of the line is median predicted | |
| 257 | + * NOTE: In the case of RGB this pixel is top predicted */ | |
| 258 | + TL = l->avctx->pix_fmt == PIX_FMT_YUV420P ? buf[-stride] : L; | |
| 257 | 259 | } else { |
| 258 | 260 | /* Top left is 2 rows back, last pixel */ |
| 259 | 261 | TL = buf[width - (2 * stride) - 1]; |
| 260 | 262 | } |
| 261 | − /* Left pixel is actually prev_row[width] */ | |
| 262 | − L = buf[width - stride - 1]; | |
| 263 | 263 | |
| 264 | 264 | add_lag_median_prediction(buf, buf - stride, buf, |
| 265 | 265 | width, &L, &TL); |