Revision 70118abd

View differences:

libavcodec/h264.c
495 495
            chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, 5, weight0, weight1, 0);
496 496
        }else{
497 497
            luma_weight_avg(dest_y, tmp_y, h->mb_linesize, h->luma_log2_weight_denom,
498
                            h->luma_weight[0][refn0], h->luma_weight[1][refn1],
499
                            h->luma_offset[0][refn0] + h->luma_offset[1][refn1]);
498
                            h->luma_weight[0][refn0][0], h->luma_weight[1][refn1][0],
499
                            h->luma_weight[0][refn0][1] + h->luma_weight[1][refn1][1]);
500 500
            chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, h->chroma_log2_weight_denom,
501
                            h->chroma_weight[0][refn0][0], h->chroma_weight[1][refn1][0],
502
                            h->chroma_offset[0][refn0][0] + h->chroma_offset[1][refn1][0]);
501
                            h->chroma_weight[0][refn0][0][0], h->chroma_weight[1][refn1][0][0],
502
                            h->chroma_weight[0][refn0][0][1] + h->chroma_weight[1][refn1][0][1]);
503 503
            chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, h->chroma_log2_weight_denom,
504
                            h->chroma_weight[0][refn0][1], h->chroma_weight[1][refn1][1],
505
                            h->chroma_offset[0][refn0][1] + h->chroma_offset[1][refn1][1]);
504
                            h->chroma_weight[0][refn0][1][0], h->chroma_weight[1][refn1][1][0],
505
                            h->chroma_weight[0][refn0][1][1] + h->chroma_weight[1][refn1][1][1]);
506 506
        }
507 507
    }else{
508 508
        int list = list1 ? 1 : 0;
......
513 513
                    qpix_put, chroma_put);
514 514

  
515 515
        luma_weight_op(dest_y, h->mb_linesize, h->luma_log2_weight_denom,
516
                       h->luma_weight[list][refn], h->luma_offset[list][refn]);
516
                       h->luma_weight[list][refn][0], h->luma_weight[list][refn][1]);
517 517
        if(h->use_weight_chroma){
518 518
            chroma_weight_op(dest_cb, h->mb_uvlinesize, h->chroma_log2_weight_denom,
519
                             h->chroma_weight[list][refn][0], h->chroma_offset[list][refn][0]);
519
                             h->chroma_weight[list][refn][0][0], h->chroma_weight[list][refn][0][1]);
520 520
            chroma_weight_op(dest_cr, h->mb_uvlinesize, h->chroma_log2_weight_denom,
521
                             h->chroma_weight[list][refn][1], h->chroma_offset[list][refn][1]);
521
                             h->chroma_weight[list][refn][1][0], h->chroma_weight[list][refn][1][1]);
522 522
        }
523 523
    }
524 524
}
......
1368 1368

  
1369 1369
            luma_weight_flag= get_bits1(&s->gb);
1370 1370
            if(luma_weight_flag){
1371
                h->luma_weight[list][i]= get_se_golomb(&s->gb);
1372
                h->luma_offset[list][i]= get_se_golomb(&s->gb);
1373
                if(   h->luma_weight[list][i] != luma_def
1374
                   || h->luma_offset[list][i] != 0) {
1371
                h->luma_weight[list][i][0]= get_se_golomb(&s->gb);
1372
                h->luma_weight[list][i][1]= get_se_golomb(&s->gb);
1373
                if(   h->luma_weight[list][i][0] != luma_def
1374
                   || h->luma_weight[list][i][1] != 0) {
1375 1375
                    h->use_weight= 1;
1376 1376
                    h->luma_weight_flag[list]= 1;
1377 1377
                }
1378 1378
            }else{
1379
                h->luma_weight[list][i]= luma_def;
1380
                h->luma_offset[list][i]= 0;
1379
                h->luma_weight[list][i][0]= luma_def;
1380
                h->luma_weight[list][i][1]= 0;
1381 1381
            }
1382 1382

  
1383 1383
            if(CHROMA){
......
1385 1385
                if(chroma_weight_flag){
1386 1386
                    int j;
1387 1387
                    for(j=0; j<2; j++){
1388
                        h->chroma_weight[list][i][j]= get_se_golomb(&s->gb);
1389
                        h->chroma_offset[list][i][j]= get_se_golomb(&s->gb);
1390
                        if(   h->chroma_weight[list][i][j] != chroma_def
1391
                           || h->chroma_offset[list][i][j] != 0) {
1388
                        h->chroma_weight[list][i][j][0]= get_se_golomb(&s->gb);
1389
                        h->chroma_weight[list][i][j][1]= get_se_golomb(&s->gb);
1390
                        if(   h->chroma_weight[list][i][j][0] != chroma_def
1391
                           || h->chroma_weight[list][i][j][1] != 0) {
1392 1392
                            h->use_weight_chroma= 1;
1393 1393
                            h->chroma_weight_flag[list]= 1;
1394 1394
                        }
......
1396 1396
                }else{
1397 1397
                    int j;
1398 1398
                    for(j=0; j<2; j++){
1399
                        h->chroma_weight[list][i][j]= chroma_def;
1400
                        h->chroma_offset[list][i][j]= 0;
1399
                        h->chroma_weight[list][i][j][0]= chroma_def;
1400
                        h->chroma_weight[list][i][j][1]= 0;
1401 1401
                    }
1402 1402
                }
1403 1403
            }
libavcodec/h264.h
417 417
    int use_weight_chroma;
418 418
    int luma_log2_weight_denom;
419 419
    int chroma_log2_weight_denom;
420
    int luma_weight[2][48];
421
    int luma_offset[2][48];
422
    int chroma_weight[2][48][2];
423
    int chroma_offset[2][48][2];
420
    int luma_weight[2][48][2];
421
    int chroma_weight[2][48][2][2];
424 422
    int implicit_weight[48][48];
425 423

  
426 424
    //deblock
libavcodec/h264_refs.c
315 315
            field[1].reference = PICT_BOTTOM_FIELD;
316 316
            field[1].poc= field[1].field_poc[1];
317 317

  
318
            h->luma_weight[list][16+2*i] = h->luma_weight[list][16+2*i+1] = h->luma_weight[list][i];
319
            h->luma_offset[list][16+2*i] = h->luma_offset[list][16+2*i+1] = h->luma_offset[list][i];
318
            h->luma_weight[list][16+2*i][0] = h->luma_weight[list][16+2*i+1][0] = h->luma_weight[list][i][0];
319
            h->luma_weight[list][16+2*i][1] = h->luma_weight[list][16+2*i+1][1] = h->luma_weight[list][i][1];
320 320
            for(j=0; j<2; j++){
321
                h->chroma_weight[list][16+2*i][j] = h->chroma_weight[list][16+2*i+1][j] = h->chroma_weight[list][i][j];
322
                h->chroma_offset[list][16+2*i][j] = h->chroma_offset[list][16+2*i+1][j] = h->chroma_offset[list][i][j];
321
                h->chroma_weight[list][16+2*i][j][0] = h->chroma_weight[list][16+2*i+1][j][0] = h->chroma_weight[list][i][j][0];
322
                h->chroma_weight[list][16+2*i][j][1] = h->chroma_weight[list][16+2*i+1][j][1] = h->chroma_weight[list][i][j][1];
323 323
            }
324 324
        }
325 325
    }

Also available in: Unified diff