Revision 41e4055b

View differences:

libavcodec/h264.c
2366 2366
    int linesize, uvlinesize /*dct_offset*/;
2367 2367
    int i;
2368 2368
    int *block_offset = &h->block_offset[0];
2369
    const int transform_bypass = (s->qscale == 0 && h->sps.transform_bypass), is_h264 = (simple || s->codec_id == CODEC_ID_H264);
2369
    const int transform_bypass = !simple && (s->qscale == 0 && h->sps.transform_bypass);
2370
    const int is_h264 = simple || s->codec_id == CODEC_ID_H264;
2370 2371
    void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);
2371 2372
    void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
2372 2373

  
......
2444 2445
                        for(i=0; i<16; i+=4){
2445 2446
                            uint8_t * const ptr= dest_y + block_offset[i];
2446 2447
                            const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
2448
                            if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
2449
                                h->hpc.pred8x8l_add[dir](ptr, h->mb + i*16, linesize);
2450
                            }else{
2447 2451
                            const int nnz = h->non_zero_count_cache[ scan8[i] ];
2448 2452
                            h->hpc.pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000,
2449 2453
                                                   (h->topright_samples_available<<i)&0x4000, linesize);
......
2453 2457
                                else
2454 2458
                                    idct_add(ptr, h->mb + i*16, linesize);
2455 2459
                            }
2460
                            }
2456 2461
                        }
2457 2462
                    }else
2458 2463
                    for(i=0; i<16; i++){
2459 2464
                        uint8_t * const ptr= dest_y + block_offset[i];
2460
                        uint8_t *topright;
2461 2465
                        const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
2462
                        int nnz, tr;
2463 2466

  
2467
                        if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
2468
                            h->hpc.pred4x4_add[dir](ptr, h->mb + i*16, linesize);
2469
                        }else{
2470
                        uint8_t *topright;
2471
                        int nnz, tr;
2464 2472
                        if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
2465 2473
                            const int topright_avail= (h->topright_samples_available<<i)&0x8000;
2466 2474
                            assert(mb_y || linesize <= block_offset[i]);
......
2483 2491
                            }else
2484 2492
                                svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
2485 2493
                        }
2494
                        }
2486 2495
                    }
2487 2496
                }
2488 2497
            }else{
......
2506 2515
        if(!IS_INTRA4x4(mb_type)){
2507 2516
            if(is_h264){
2508 2517
                if(IS_INTRA16x16(mb_type)){
2518
                    if(transform_bypass && h->sps.profile_idc==244 && (h->intra16x16_pred_mode==VERT_PRED8x8 || h->intra16x16_pred_mode==HOR_PRED8x8)){
2519
                        h->hpc.pred16x16_add[h->intra16x16_pred_mode](dest_y, block_offset, h->mb, linesize);
2520
                    }else{
2509 2521
                    for(i=0; i<16; i++){
2510 2522
                        if(h->non_zero_count_cache[ scan8[i] ])
2511 2523
                            idct_add(dest_y + block_offset[i], h->mb + i*16, linesize);
2512 2524
                        else if(h->mb[i*16])
2513 2525
                            idct_dc_add(dest_y + block_offset[i], h->mb + i*16, linesize);
2514 2526
                    }
2527
                    }
2515 2528
                }else{
2516 2529
                    const int di = IS_8x8DCT(mb_type) ? 4 : 1;
2517 2530
                    for(i=0; i<16; i+=di){
......
2545 2558
                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]);
2546 2559
            }
2547 2560
            if(is_h264){
2561
                if(transform_bypass && IS_INTRA(mb_type) && h->sps.profile_idc==244 && (h->chroma_pred_mode==VERT_PRED8x8 || h->chroma_pred_mode==HOR_PRED8x8)){
2562
                    h->hpc.pred8x8_add[h->chroma_pred_mode](dest[0], block_offset + 16, h->mb + 16*16, uvlinesize);
2563
                    h->hpc.pred8x8_add[h->chroma_pred_mode](dest[1], block_offset + 20, h->mb + 20*16, uvlinesize);
2564
                }else{
2548 2565
                for(i=16; i<16+8; i++){
2549 2566
                    if(h->non_zero_count_cache[ scan8[i] ])
2550 2567
                        idct_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2551 2568
                    else if(h->mb[i*16])
2552 2569
                        idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2553 2570
                }
2571
                }
2554 2572
            }else{
2555 2573
                for(i=16; i<16+8; i++){
2556 2574
                    if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
......
2593 2611
    const int mb_xy= h->mb_xy;
2594 2612
    const int mb_type= s->current_picture.mb_type[mb_xy];
2595 2613
    int is_complex = FRAME_MBAFF || MB_FIELD || IS_INTRA_PCM(mb_type) || s->codec_id != CODEC_ID_H264 ||
2596
                    (ENABLE_GRAY && (s->flags&CODEC_FLAG_GRAY)) || (ENABLE_H264_ENCODER && s->encoding) || ENABLE_SMALL;
2614
                    (ENABLE_GRAY && (s->flags&CODEC_FLAG_GRAY)) || (ENABLE_H264_ENCODER && s->encoding) || ENABLE_SMALL ||
2615
                    s->qscale == 0;
2597 2616

  
2598 2617
    if(ENABLE_H264_ENCODER && !s->decode)
2599 2618
        return;

Also available in: Unified diff