aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorNathan Caldwell <saintdev@gmail.com>2011-11-16 00:45:00 -0700
committerMartin Storsjö <martin@martin.st>2011-11-16 10:46:30 +0200
commit39616fc30746ca07608f7855e85bd89cb08cfd27 (patch)
treec0624db1e0c83ca353baca0d6287bfbd0abb1281 /libavcodec
parent52767d891c665ab1124fe4ce82d99b59673de7d2 (diff)
downloadffmpeg-39616fc30746ca07608f7855e85bd89cb08cfd27.tar.gz
lagarith: Add correct line prediction for RGB
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/lagarith.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index 10cc71e0d8..9200773a65 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -245,21 +245,21 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf,
{
int L, TL;
+ /* Left pixel is actually prev_row[width] */
+ L = buf[width - stride - 1];
if (!line) {
/* Left prediction only for first line */
L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1,
width - 1, buf[0]);
return;
} else if (line == 1) {
- /* 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 */
- TL = buf[-stride];
+ /* Second line, left predict first pixel, the rest of the line is median predicted
+ * NOTE: In the case of RGB this pixel is top predicted */
+ TL = l->avctx->pix_fmt == PIX_FMT_YUV420P ? buf[-stride] : L;
} else {
/* Top left is 2 rows back, last pixel */
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,
width, &L, &TL);