Revision aebb5d6d

View differences:

libavcodec/h264.c
2463 2463
                            idct_dc_add = s->dsp.h264_idct_dc_add;
2464 2464
                            idct_add    = s->dsp.h264_idct_add;
2465 2465
                        }
2466
                    for(i=0; i<16; i++){
2467
                        uint8_t * const ptr= dest_y + block_offset[i];
2468
                        const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
2466
                        for(i=0; i<16; i++){
2467
                            uint8_t * const ptr= dest_y + block_offset[i];
2468
                            const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
2469 2469

  
2470
                        if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
2471
                            h->hpc.pred4x4_add[dir](ptr, h->mb + i*16, linesize);
2472
                        }else{
2473
                            uint8_t *topright;
2474
                            int nnz, tr;
2475
                            if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
2476
                                const int topright_avail= (h->topright_samples_available<<i)&0x8000;
2477
                                assert(mb_y || linesize <= block_offset[i]);
2478
                                if(!topright_avail){
2479
                                    tr= ptr[3 - linesize]*0x01010101;
2480
                                    topright= (uint8_t*) &tr;
2481
                                }else
2482
                                    topright= ptr + 4 - linesize;
2483
                            }else
2484
                                topright= NULL;
2485

  
2486
                            h->hpc.pred4x4[ dir ](ptr, topright, linesize);
2487
                            nnz = h->non_zero_count_cache[ scan8[i] ];
2488
                            if(nnz){
2489
                                if(is_h264){
2490
                                    if(nnz == 1 && h->mb[i*16])
2491
                                        idct_dc_add(ptr, h->mb + i*16, linesize);
2492
                                    else
2493
                                        idct_add   (ptr, h->mb + i*16, linesize);
2470
                            if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
2471
                                h->hpc.pred4x4_add[dir](ptr, h->mb + i*16, linesize);
2472
                            }else{
2473
                                uint8_t *topright;
2474
                                int nnz, tr;
2475
                                if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
2476
                                    const int topright_avail= (h->topright_samples_available<<i)&0x8000;
2477
                                    assert(mb_y || linesize <= block_offset[i]);
2478
                                    if(!topright_avail){
2479
                                        tr= ptr[3 - linesize]*0x01010101;
2480
                                        topright= (uint8_t*) &tr;
2481
                                    }else
2482
                                        topright= ptr + 4 - linesize;
2494 2483
                                }else
2495
                                    svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
2484
                                    topright= NULL;
2485

  
2486
                                h->hpc.pred4x4[ dir ](ptr, topright, linesize);
2487
                                nnz = h->non_zero_count_cache[ scan8[i] ];
2488
                                if(nnz){
2489
                                    if(is_h264){
2490
                                        if(nnz == 1 && h->mb[i*16])
2491
                                            idct_dc_add(ptr, h->mb + i*16, linesize);
2492
                                        else
2493
                                            idct_add   (ptr, h->mb + i*16, linesize);
2494
                                    }else
2495
                                        svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
2496
                                }
2496 2497
                            }
2497 2498
                        }
2498 2499
                    }
2499
                    }
2500 2500
                }
2501 2501
            }else{
2502 2502
                h->hpc.pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize);
......
2576 2576
                idct_dc_add = s->dsp.h264_idct_dc_add;
2577 2577
                chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp[0], h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
2578 2578
                chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp[1], h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
2579
            if(is_h264){
2579
                if(is_h264){
2580 2580
                    for(i=16; i<16+8; i++){
2581 2581
                        if(h->non_zero_count_cache[ scan8[i] ])
2582 2582
                            idct_add   (dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2583 2583
                        else if(h->mb[i*16])
2584 2584
                            idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2585 2585
                    }
2586
            }else{
2587
                for(i=16; i<16+8; i++){
2588
                    if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
2589
                        uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i];
2590
                        svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2);
2586
                }else{
2587
                    for(i=16; i<16+8; i++){
2588
                        if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
2589
                            uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i];
2590
                            svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2);
2591
                        }
2591 2592
                    }
2592 2593
                }
2593
                }
2594 2594
            }
2595 2595
        }
2596 2596
    }

Also available in: Unified diff