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
245245 {
246246 int L, TL;
247247
248+ /* Left pixel is actually prev_row[width] */
249+ L = buf[width - stride - 1];
248250 if (!line) {
249251 /* Left prediction only for first line */
250252 L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1,
251253 width - 1, buf[0]);
252254 return;
253255 } 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;
257259 } else {
258260 /* Top left is 2 rows back, last pixel */
259261 TL = buf[width - (2 * stride) - 1];
260262 }
261− /* Left pixel is actually prev_row[width] */
262− L = buf[width - stride - 1];
263263
264264 add_lag_median_prediction(buf, buf - stride, buf,
265265 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