1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

h264 - Fix PCM intra coded blocks in monochrome case

This commit is contained in:
Jeff Downs 2011-07-05 13:20:06 -04:00
parent 956c901c68
commit 188694b2f5

View File

@ -1809,8 +1809,8 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, i
}
if (!simple && IS_INTRA_PCM(mb_type)) {
if (pixel_shift) {
const int bit_depth = h->sps.bit_depth_luma;
if (pixel_shift) {
int j;
GetBitContext gb;
init_get_bits(&gb, (uint8_t*)h->mb, 384*bit_depth);
@ -1821,6 +1821,15 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, i
tmp_y[j] = get_bits(&gb, bit_depth);
}
if(simple || !CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
if (!h->sps.chroma_format_idc) {
for (i = 0; i < 8; i++) {
uint16_t *tmp_cb = (uint16_t*)(dest_cb + i*uvlinesize);
uint16_t *tmp_cr = (uint16_t*)(dest_cr + i*uvlinesize);
for (j = 0; j < 8; j++) {
tmp_cb[j] = tmp_cr[j] = 1 << (bit_depth - 1);
}
}
} else {
for (i = 0; i < 8; i++) {
uint16_t *tmp_cb = (uint16_t*)(dest_cb + i*uvlinesize);
for (j = 0; j < 8; j++)
@ -1832,17 +1841,25 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, i
tmp_cr[j] = get_bits(&gb, bit_depth);
}
}
}
} else {
for (i=0; i<16; i++) {
memcpy(dest_y + i* linesize, h->mb + i*8, 16);
}
if(simple || !CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
if (!h->sps.chroma_format_idc) {
for (i=0; i<8; i++) {
memset(dest_cb+ i*uvlinesize, 1 << (bit_depth - 1), 8);
memset(dest_cr+ i*uvlinesize, 1 << (bit_depth - 1), 8);
}
} else {
for (i=0; i<8; i++) {
memcpy(dest_cb+ i*uvlinesize, h->mb + 128 + i*4, 8);
memcpy(dest_cr+ i*uvlinesize, h->mb + 160 + i*4, 8);
}
}
}
}
} else {
if(IS_INTRA(mb_type)){
if(h->deblocking_filter)