History

lagarith: Add correct line prediction for RGB

Nathan Caldwell committed 15 years ago

Commit 39616fc1 parent 52767d81 file · +5 −5Browse files

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t