Revision ac0623b2 libavcodec/h264.c

View differences:

libavcodec/h264.c
2448 2448
                            if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
2449 2449
                                h->hpc.pred8x8l_add[dir](ptr, h->mb + i*16, linesize);
2450 2450
                            }else{
2451
                            const int nnz = h->non_zero_count_cache[ scan8[i] ];
2452
                            h->hpc.pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000,
2453
                                                   (h->topright_samples_available<<i)&0x4000, linesize);
2454
                            if(nnz){
2455
                                if(nnz == 1 && h->mb[i*16])
2456
                                    idct_dc_add(ptr, h->mb + i*16, linesize);
2457
                                else
2458
                                    idct_add(ptr, h->mb + i*16, linesize);
2459
                            }
2451
                                const int nnz = h->non_zero_count_cache[ scan8[i] ];
2452
                                h->hpc.pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000,
2453
                                                            (h->topright_samples_available<<i)&0x4000, linesize);
2454
                                if(nnz){
2455
                                    if(nnz == 1 && h->mb[i*16])
2456
                                        idct_dc_add(ptr, h->mb + i*16, linesize);
2457
                                    else
2458
                                        idct_add   (ptr, h->mb + i*16, linesize);
2459
                                }
2460 2460
                            }
2461 2461
                        }
2462 2462
                    }else
......
2467 2467
                        if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
2468 2468
                            h->hpc.pred4x4_add[dir](ptr, h->mb + i*16, linesize);
2469 2469
                        }else{
2470
                        uint8_t *topright;
2471
                        int nnz, tr;
2472
                        if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
2473
                            const int topright_avail= (h->topright_samples_available<<i)&0x8000;
2474
                            assert(mb_y || linesize <= block_offset[i]);
2475
                            if(!topright_avail){
2476
                                tr= ptr[3 - linesize]*0x01010101;
2477
                                topright= (uint8_t*) &tr;
2470
                            uint8_t *topright;
2471
                            int nnz, tr;
2472
                            if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
2473
                                const int topright_avail= (h->topright_samples_available<<i)&0x8000;
2474
                                assert(mb_y || linesize <= block_offset[i]);
2475
                                if(!topright_avail){
2476
                                    tr= ptr[3 - linesize]*0x01010101;
2477
                                    topright= (uint8_t*) &tr;
2478
                                }else
2479
                                    topright= ptr + 4 - linesize;
2478 2480
                            }else
2479
                                topright= ptr + 4 - linesize;
2480
                        }else
2481
                            topright= NULL;
2481
                                topright= NULL;
2482 2482

  
2483
                        h->hpc.pred4x4[ dir ](ptr, topright, linesize);
2484
                        nnz = h->non_zero_count_cache[ scan8[i] ];
2485
                        if(nnz){
2486
                            if(is_h264){
2487
                                if(nnz == 1 && h->mb[i*16])
2488
                                    idct_dc_add(ptr, h->mb + i*16, linesize);
2489
                                else
2490
                                    idct_add(ptr, h->mb + i*16, linesize);
2491
                            }else
2492
                                svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
2493
                        }
2483
                            h->hpc.pred4x4[ dir ](ptr, topright, linesize);
2484
                            nnz = h->non_zero_count_cache[ scan8[i] ];
2485
                            if(nnz){
2486
                                if(is_h264){
2487
                                    if(nnz == 1 && h->mb[i*16])
2488
                                        idct_dc_add(ptr, h->mb + i*16, linesize);
2489
                                    else
2490
                                        idct_add   (ptr, h->mb + i*16, linesize);
2491
                                }else
2492
                                    svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
2493
                            }
2494 2494
                        }
2495 2495
                    }
2496 2496
                }
......
2518 2518
                    if(transform_bypass && h->sps.profile_idc==244 && (h->intra16x16_pred_mode==VERT_PRED8x8 || h->intra16x16_pred_mode==HOR_PRED8x8)){
2519 2519
                        h->hpc.pred16x16_add[h->intra16x16_pred_mode](dest_y, block_offset, h->mb, linesize);
2520 2520
                    }else{
2521
                    for(i=0; i<16; i++){
2522
                        if(h->non_zero_count_cache[ scan8[i] ])
2523
                            idct_add(dest_y + block_offset[i], h->mb + i*16, linesize);
2524
                        else if(h->mb[i*16])
2525
                            idct_dc_add(dest_y + block_offset[i], h->mb + i*16, linesize);
2526
                    }
2521
                        for(i=0; i<16; i++){
2522
                            if(h->non_zero_count_cache[ scan8[i] ])
2523
                                idct_add   (dest_y + block_offset[i], h->mb + i*16, linesize);
2524
                            else if(h->mb[i*16])
2525
                                idct_dc_add(dest_y + block_offset[i], h->mb + i*16, linesize);
2526
                        }
2527 2527
                    }
2528 2528
                }else{
2529 2529
                    const int di = IS_8x8DCT(mb_type) ? 4 : 1;
......
2562 2562
                    h->hpc.pred8x8_add[h->chroma_pred_mode](dest[0], block_offset + 16, h->mb + 16*16, uvlinesize);
2563 2563
                    h->hpc.pred8x8_add[h->chroma_pred_mode](dest[1], block_offset + 20, h->mb + 20*16, uvlinesize);
2564 2564
                }else{
2565
                for(i=16; i<16+8; i++){
2566
                    if(h->non_zero_count_cache[ scan8[i] ])
2567
                        idct_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2568
                    else if(h->mb[i*16])
2569
                        idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2570
                }
2565
                    for(i=16; i<16+8; i++){
2566
                        if(h->non_zero_count_cache[ scan8[i] ])
2567
                            idct_add   (dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2568
                        else if(h->mb[i*16])
2569
                            idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2570
                    }
2571 2571
                }
2572 2572
            }else{
2573 2573
                for(i=16; i<16+8; i++){

Also available in: Unified diff