Revision 621f9a40 libavcodec/vp3.c

View differences:

libavcodec/vp3.c
1394 1394
    int x, y;
1395 1395
    int *bounding_values= s->bounding_values_array+127;
1396 1396

  
1397
        int width           = s->fragment_width  >> !!plane;
1398
        int height          = s->fragment_height >> !!plane;
1399
        int fragment        = s->fragment_start        [plane] + ystart * width;
1400
        int stride          = s->current_frame.linesize[plane];
1401
        uint8_t *plane_data = s->current_frame.data    [plane];
1402
        if (!s->flipped_image) stride = -stride;
1403

  
1404
        for (y = ystart; y < yend; y++) {
1405

  
1406
            for (x = 0; x < width; x++) {
1407
                /* This code basically just deblocks on the edges of coded blocks.
1408
                 * However, it has to be much more complicated because of the
1409
                 * braindamaged deblock ordering used in VP3/Theora. Order matters
1410
                 * because some pixels get filtered twice. */
1411
                if( s->all_fragments[fragment].coding_method != MODE_COPY )
1412
                {
1413
                    /* do not perform left edge filter for left columns frags */
1414
                    if (x > 0) {
1415
                        s->dsp.vp3_h_loop_filter(
1416
                            plane_data + s->all_fragments[fragment].first_pixel,
1417
                            stride, bounding_values);
1418
                    }
1419

  
1420
                    /* do not perform top edge filter for top row fragments */
1421
                    if (y > 0) {
1422
                        s->dsp.vp3_v_loop_filter(
1423
                            plane_data + s->all_fragments[fragment].first_pixel,
1424
                            stride, bounding_values);
1425
                    }
1397
    int width           = s->fragment_width  >> !!plane;
1398
    int height          = s->fragment_height >> !!plane;
1399
    int fragment        = s->fragment_start        [plane] + ystart * width;
1400
    int stride          = s->current_frame.linesize[plane];
1401
    uint8_t *plane_data = s->current_frame.data    [plane];
1402
    if (!s->flipped_image) stride = -stride;
1403

  
1404
    for (y = ystart; y < yend; y++) {
1405

  
1406
        for (x = 0; x < width; x++) {
1407
            /* This code basically just deblocks on the edges of coded blocks.
1408
             * However, it has to be much more complicated because of the
1409
             * braindamaged deblock ordering used in VP3/Theora. Order matters
1410
             * because some pixels get filtered twice. */
1411
            if( s->all_fragments[fragment].coding_method != MODE_COPY )
1412
            {
1413
                /* do not perform left edge filter for left columns frags */
1414
                if (x > 0) {
1415
                    s->dsp.vp3_h_loop_filter(
1416
                        plane_data + s->all_fragments[fragment].first_pixel,
1417
                        stride, bounding_values);
1418
                }
1426 1419

  
1427
                    /* do not perform right edge filter for right column
1428
                     * fragments or if right fragment neighbor is also coded
1429
                     * in this frame (it will be filtered in next iteration) */
1430
                    if ((x < width - 1) &&
1431
                        (s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
1432
                        s->dsp.vp3_h_loop_filter(
1433
                            plane_data + s->all_fragments[fragment + 1].first_pixel,
1434
                            stride, bounding_values);
1435
                    }
1420
                /* do not perform top edge filter for top row fragments */
1421
                if (y > 0) {
1422
                    s->dsp.vp3_v_loop_filter(
1423
                        plane_data + s->all_fragments[fragment].first_pixel,
1424
                        stride, bounding_values);
1425
                }
1436 1426

  
1437
                    /* do not perform bottom edge filter for bottom row
1438
                     * fragments or if bottom fragment neighbor is also coded
1439
                     * in this frame (it will be filtered in the next row) */
1440
                    if ((y < height - 1) &&
1441
                        (s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
1442
                        s->dsp.vp3_v_loop_filter(
1443
                            plane_data + s->all_fragments[fragment + width].first_pixel,
1444
                            stride, bounding_values);
1445
                    }
1427
                /* do not perform right edge filter for right column
1428
                 * fragments or if right fragment neighbor is also coded
1429
                 * in this frame (it will be filtered in next iteration) */
1430
                if ((x < width - 1) &&
1431
                    (s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
1432
                    s->dsp.vp3_h_loop_filter(
1433
                        plane_data + s->all_fragments[fragment + 1].first_pixel,
1434
                        stride, bounding_values);
1446 1435
                }
1447 1436

  
1448
                fragment++;
1437
                /* do not perform bottom edge filter for bottom row
1438
                 * fragments or if bottom fragment neighbor is also coded
1439
                 * in this frame (it will be filtered in the next row) */
1440
                if ((y < height - 1) &&
1441
                    (s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
1442
                    s->dsp.vp3_v_loop_filter(
1443
                        plane_data + s->all_fragments[fragment + width].first_pixel,
1444
                        stride, bounding_values);
1445
                }
1449 1446
            }
1447

  
1448
            fragment++;
1450 1449
        }
1450
    }
1451 1451
}
1452 1452

  
1453 1453
/*

Also available in: Unified diff