h264.c
static int decode_slice_header(H264Context *h, H264Context *h0){
...
...
h->deblocking_filter = 1;
h->slice_alpha_c0_offset = 52;
h->slice_beta_offset = 52;
if( h->pps.deblocking_filter_parameters_present ) {
tmp= get_ue_golomb_31(&s->gb);
if(tmp > 2){
av_log(s->avctx, AV_LOG_ERROR, "deblocking_filter_idc %u out of range\n", tmp);
return -1;
}
h->deblocking_filter= tmp;
if(h->deblocking_filter < 2)
h->deblocking_filter^= 1; // 1<->0
if( h->deblocking_filter ) {
h->slice_alpha_c0_offset += get_se_golomb(&s->gb) << 1;
h->slice_beta_offset += get_se_golomb(&s->gb) << 1;
if( h->slice_alpha_c0_offset > 104U
|| h->slice_beta_offset > 104U){
av_log(s->avctx, AV_LOG_ERROR, "deblocking filter parameters %d %d out of range\n", h->slice_alpha_c0_offset, h->slice_beta_offset);
return -1;
}
}
}
h->deblocking_filter = 0; // turn off deblocking filter
if( s->avctx->skip_loop_filter >= AVDISCARD_ALL
||(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type_nos != AV_PICTURE_TYPE_I)
||(s->avctx->skip_loop_filter >= AVDISCARD_BIDIR && h->slice_type_nos == AV_PICTURE_TYPE_B)
||(s->avctx->skip_loop_filter >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
h->deblocking_filter= 0;
...
...
* 디블러킹 필터를 끄면 화질 열화현상이 발생하지만 약 20% 정도의 성능개선 효과를 볼 수 있다. 작은 화면을 플레이할때는 화질 열화현상이 눈에 잘 띄지않아서 경우에 따라 적용해봄직 하다.