History

avcodec/hevc_ps: use get_{ue,se}_golomb() for some PPS Range extension fields

James Almer committed 3 years ago

Commit 41dd50a1 parent df3fd3a1 file · +7 −7Browse files

Unified · Split

libavcodec/hevc_ps.c+7−7
@@ -1478,33 +1478,33 @@ static int pps_range_extensions(GetBitContext *gb, AVCodecContext *avctx, · 1477 unmodified lines
1478 HEVCPPS *pps, HEVCSPS *sps)1478 HEVCPPS *pps, HEVCSPS *sps)
1479{1479{
1480 if (pps->transform_skip_enabled_flag) {1480 if (pps->transform_skip_enabled_flag) {
1481 pps->log2_max_transform_skip_block_size = get_ue_golomb_long(gb) + 2;1481 pps->log2_max_transform_skip_block_size = get_ue_golomb_31(gb) + 2;
1482 }1482 }
1483 pps->cross_component_prediction_enabled_flag = get_bits1(gb);1483 pps->cross_component_prediction_enabled_flag = get_bits1(gb);
1484 pps->chroma_qp_offset_list_enabled_flag = get_bits1(gb);1484 pps->chroma_qp_offset_list_enabled_flag = get_bits1(gb);
1485 if (pps->chroma_qp_offset_list_enabled_flag) {1485 if (pps->chroma_qp_offset_list_enabled_flag) {
1486 pps->diff_cu_chroma_qp_offset_depth = get_ue_golomb_long(gb);1486 pps->diff_cu_chroma_qp_offset_depth = get_ue_golomb_31(gb);
1487 pps->chroma_qp_offset_list_len_minus1 = get_ue_golomb_long(gb);1487 pps->chroma_qp_offset_list_len_minus1 = get_ue_golomb_31(gb);
1488 if (pps->chroma_qp_offset_list_len_minus1 > 5) {1488 if (pps->chroma_qp_offset_list_len_minus1 > 5) {
1489 av_log(avctx, AV_LOG_ERROR,1489 av_log(avctx, AV_LOG_ERROR,
1490 "chroma_qp_offset_list_len_minus1 shall be in the range [0, 5].\n");1490 "chroma_qp_offset_list_len_minus1 shall be in the range [0, 5].\n");
1491 return AVERROR_INVALIDDATA;1491 return AVERROR_INVALIDDATA;
1492 }1492 }
1493 for (int i = 0; i <= pps->chroma_qp_offset_list_len_minus1; i++) {1493 for (int i = 0; i <= pps->chroma_qp_offset_list_len_minus1; i++) {
1494 pps->cb_qp_offset_list[i] = get_se_golomb_long(gb);1494 pps->cb_qp_offset_list[i] = get_se_golomb(gb);
1495 if (pps->cb_qp_offset_list[i]) {1495 if (pps->cb_qp_offset_list[i]) {
1496 av_log(avctx, AV_LOG_WARNING,1496 av_log(avctx, AV_LOG_WARNING,
1497 "cb_qp_offset_list not tested yet.\n");1497 "cb_qp_offset_list not tested yet.\n");
1498 }1498 }
1499 pps->cr_qp_offset_list[i] = get_se_golomb_long(gb);1499 pps->cr_qp_offset_list[i] = get_se_golomb(gb);
1500 if (pps->cr_qp_offset_list[i]) {1500 if (pps->cr_qp_offset_list[i]) {
1501 av_log(avctx, AV_LOG_WARNING,1501 av_log(avctx, AV_LOG_WARNING,
1502 "cb_qp_offset_list not tested yet.\n");1502 "cb_qp_offset_list not tested yet.\n");
1503 }1503 }
1504 }1504 }
1505 }1505 }
1506 pps->log2_sao_offset_scale_luma = get_ue_golomb_long(gb);1506 pps->log2_sao_offset_scale_luma = get_ue_golomb_31(gb);
1507 pps->log2_sao_offset_scale_chroma = get_ue_golomb_long(gb);1507 pps->log2_sao_offset_scale_chroma = get_ue_golomb_31(gb);
1508 1508
1509 if ( pps->log2_sao_offset_scale_luma > FFMAX(sps->bit_depth - 10, 0)1509 if ( pps->log2_sao_offset_scale_luma > FFMAX(sps->bit_depth - 10, 0)
1510 || pps->log2_sao_offset_scale_chroma > FFMAX(sps->bit_depth_chroma - 10, 0)1510 || pps->log2_sao_offset_scale_chroma > FFMAX(sps->bit_depth_chroma - 10, 0)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t