Commit 2b3b52d5 authored by Michael Niedermayer's avatar Michael Niedermayer

lagarith: fix alignment on buffers passed into prediction dsp code.

This should fix issues with direct rendering
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 732dfc76
...@@ -250,8 +250,8 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf, ...@@ -250,8 +250,8 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf,
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, buf,
width - 1, buf[0]); width, 0);
} else { } else {
/* Left pixel is actually prev_row[width] */ /* Left pixel is actually prev_row[width] */
L = buf[width - stride - 1]; L = buf[width - stride - 1];
...@@ -277,11 +277,12 @@ static void lag_pred_line_yuy2(LagarithContext *l, uint8_t *buf, ...@@ -277,11 +277,12 @@ static void lag_pred_line_yuy2(LagarithContext *l, uint8_t *buf,
int L, TL; int L, TL;
if (!line) { if (!line) {
if (is_luma) { L= buf[0];
buf++; if (is_luma)
width--; buf[0] = 0;
} l->dsp.add_hfyu_left_prediction(buf, buf, width, 0);
l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1, width - 1, buf[0]); if (is_luma)
buf[0] = L;
return; return;
} }
if (line == 1) { if (line == 1) {
...@@ -294,14 +295,17 @@ static void lag_pred_line_yuy2(LagarithContext *l, uint8_t *buf, ...@@ -294,14 +295,17 @@ static void lag_pred_line_yuy2(LagarithContext *l, uint8_t *buf,
L += buf[i]; L += buf[i];
buf[i] = L; buf[i] = L;
} }
buf += HEAD; for (; i<width; i++) {
width -= HEAD; L = mid_pred(L&0xFF, buf[i-stride], (L + buf[i-stride] - TL)&0xFF) + buf[i];
TL = buf[i-stride];
buf[i]= L;
}
} else { } else {
TL = buf[width - (2 * stride) - 1]; TL = buf[width - (2 * stride) - 1];
L = buf[width - stride - 1]; L = buf[width - stride - 1];
}
l->dsp.add_hfyu_median_prediction(buf, buf - stride, buf, width, l->dsp.add_hfyu_median_prediction(buf, buf - stride, buf, width,
&L, &TL); &L, &TL);
}
} }
static int lag_decode_line(LagarithContext *l, lag_rac *rac, static int lag_decode_line(LagarithContext *l, lag_rac *rac,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment