Revision c1708e8d libavcodec/h264.c

View differences:

libavcodec/h264.c
2502 2502
    }
2503 2503

  
2504 2504
    if (!simple && IS_INTRA_PCM(mb_type)) {
2505
        unsigned int x, y;
2506

  
2507
        // The pixels are stored in h->mb array in the same order as levels,
2508
        // copy them in output in the correct order.
2509
        for(i=0; i<16; i++) {
2510
            for (y=0; y<4; y++) {
2511
                for (x=0; x<4; x++) {
2512
                    *(dest_y + block_offset[i] + y*linesize + x) = h->mb[i*16+y*4+x];
2513
                }
2514
            }
2515
        }
2516
        for(i=16; i<16+4; i++) {
2517
            for (y=0; y<4; y++) {
2518
                for (x=0; x<4; x++) {
2519
                    *(dest_cb + block_offset[i] + y*uvlinesize + x) = h->mb[i*16+y*4+x];
2520
                }
2521
            }
2505
        for (i=0; i<16; i++) {
2506
            memcpy(dest_y + i*  linesize, h->mb       + i*8, 16);
2522 2507
        }
2523
        for(i=20; i<20+4; i++) {
2524
            for (y=0; y<4; y++) {
2525
                for (x=0; x<4; x++) {
2526
                    *(dest_cr + block_offset[i] + y*uvlinesize + x) = h->mb[i*16+y*4+x];
2527
                }
2528
            }
2508
        for (i=0; i<8; i++) {
2509
            memcpy(dest_cb+ i*uvlinesize, h->mb + 128 + i*4,  8);
2510
            memcpy(dest_cr+ i*uvlinesize, h->mb + 160 + i*4,  8);
2529 2511
        }
2530 2512
    } else {
2531 2513
        if(IS_INTRA(mb_type)){
......
4405 4387
    h->slice_table[ mb_xy ]= h->slice_num;
4406 4388

  
4407 4389
    if(IS_INTRA_PCM(mb_type)){
4408
        unsigned int x, y;
4390
        unsigned int x;
4409 4391

  
4410 4392
        // We assume these blocks are very rare so we do not optimize it.
4411 4393
        align_get_bits(&s->gb);
4412 4394

  
4413 4395
        // The pixels are stored in the same order as levels in h->mb array.
4414
        for(y=0; y<16; y++){
4415
            const int index= 4*(y&3) + 32*((y>>2)&1) + 128*(y>>3);
4416
            for(x=0; x<16; x++){
4417
                tprintf(s->avctx, "LUMA ICPM LEVEL (%3d)\n", show_bits(&s->gb, 8));
4418
                h->mb[index + (x&3) + 16*((x>>2)&1) + 64*(x>>3)]= get_bits(&s->gb, 8);
4419
            }
4420
        }
4421
        if(CHROMA){
4422
            for(y=0; y<8; y++){
4423
                const int index= 256 + 4*(y&3) + 32*(y>>2);
4424
                for(x=0; x<8; x++){
4425
                    tprintf(s->avctx, "CHROMA U ICPM LEVEL (%3d)\n", show_bits(&s->gb, 8));
4426
                    h->mb[index + (x&3) + 16*(x>>2)]= get_bits(&s->gb, 8);
4427
                }
4428
            }
4429
            for(y=0; y<8; y++){
4430
                const int index= 256 + 64 + 4*(y&3) + 32*(y>>2);
4431
                for(x=0; x<8; x++){
4432
                    tprintf(s->avctx, "CHROMA V ICPM LEVEL (%3d)\n", show_bits(&s->gb, 8));
4433
                    h->mb[index + (x&3) + 16*(x>>2)]= get_bits(&s->gb, 8);
4434
                }
4435
            }
4396
        for(x=0; x < (CHROMA ? 384 : 256); x++){
4397
            ((uint8_t*)h->mb)[x]= get_bits(&s->gb, 8);
4436 4398
        }
4437 4399

  
4438 4400
        // In deblocking, the quantizer is 0
......
5545 5507

  
5546 5508
    if(IS_INTRA_PCM(mb_type)) {
5547 5509
        const uint8_t *ptr;
5548
        unsigned int x, y;
5549 5510

  
5550 5511
        // We assume these blocks are very rare so we do not optimize it.
5551 5512
        // FIXME The two following lines get the bitstream position in the cabac
......
5557 5518
        }
5558 5519

  
5559 5520
        // The pixels are stored in the same order as levels in h->mb array.
5560
        for(y=0; y<16; y++){
5561
            const int index= 4*(y&3) + 32*((y>>2)&1) + 128*(y>>3);
5562
            for(x=0; x<16; x++){
5563
                tprintf(s->avctx, "LUMA ICPM LEVEL (%3d)\n", *ptr);
5564
                h->mb[index + (x&3) + 16*((x>>2)&1) + 64*(x>>3)]= *ptr++;
5565
            }
5566
        }
5521
        memcpy(h->mb, ptr, 256); ptr+=256;
5567 5522
        if(CHROMA){
5568
            for(y=0; y<8; y++){
5569
                const int index= 256 + 4*(y&3) + 32*(y>>2);
5570
                for(x=0; x<8; x++){
5571
                    tprintf(s->avctx, "CHROMA U ICPM LEVEL (%3d)\n", *ptr);
5572
                    h->mb[index + (x&3) + 16*(x>>2)]= *ptr++;
5573
                }
5574
            }
5575
            for(y=0; y<8; y++){
5576
                const int index= 256 + 64 + 4*(y&3) + 32*(y>>2);
5577
                for(x=0; x<8; x++){
5578
                    tprintf(s->avctx, "CHROMA V ICPM LEVEL (%3d)\n", *ptr);
5579
                    h->mb[index + (x&3) + 16*(x>>2)]= *ptr++;
5580
                }
5581
            }
5523
            memcpy(h->mb+128, ptr, 128); ptr+=128;
5582 5524
        }
5583 5525

  
5584 5526
        ff_init_cabac_decoder(&h->cabac, ptr, h->cabac.bytestream_end - ptr);

Also available in: Unified diff