Lines Matching refs:pps

280                                     const PPS *pps, int is_sps,
299 if (is_sps || pps->transform_8x8_mode) {
328 ps->pps = NULL;
643 static void init_dequant8_coeff_table(PPS *pps, const SPS *sps)
649 pps->dequant8_coeff[i] = pps->dequant8_buffer[i];
651 if (!memcmp(pps->scaling_matrix8[j], pps->scaling_matrix8[i],
653 pps->dequant8_coeff[i] = pps->dequant8_buffer[j];
663 pps->dequant8_coeff[i][q][(x >> 3) | ((x & 7) << 3)] =
665 pps->scaling_matrix8[i][x]) << shift;
670 static void init_dequant4_coeff_table(PPS *pps, const SPS *sps)
675 pps->dequant4_coeff[i] = pps->dequant4_buffer[i];
677 if (!memcmp(pps->scaling_matrix4[j], pps->scaling_matrix4[i],
679 pps->dequant4_coeff[i] = pps->dequant4_buffer[j];
689 pps->dequant4_coeff[i][q][(x >> 2) | ((x << 2) & 0xF)] =
691 pps->scaling_matrix4[i][x]) << shift;
696 static void init_dequant_tables(PPS *pps, const SPS *sps)
699 init_dequant4_coeff_table(pps, sps);
700 memset(pps->dequant8_coeff, 0, sizeof(pps->dequant8_coeff));
702 if (pps->transform_8x8_mode)
703 init_dequant8_coeff_table(pps, sps);
707 pps->dequant4_coeff[i][0][x] = 1 << 6;
708 if (pps->transform_8x8_mode)
711 pps->dequant8_coeff[i][0][x] = 1 << 6;
715 static void build_qp_table(PPS *pps, int t, int index, const int depth)
720 pps->chroma_qp_table[t][i] =
740 PPS *pps = (PPS*)data;
742 av_buffer_unref(&pps->sps_ref);
753 PPS *pps;
763 pps = av_mallocz(sizeof(*pps));
764 if (!pps)
766 pps_buf = av_buffer_create((uint8_t*)pps, sizeof(*pps),
769 av_freep(&pps);
773 pps->data_size = gb->buffer_end - gb->buffer;
774 if (pps->data_size > sizeof(pps->data)) {
777 pps->data_size, sizeof(pps->data));
778 pps->data_size = sizeof(pps->data);
780 memcpy(pps->data, gb->buffer, pps->data_size);
783 if (!(bit_length & 7) && pps->data_size < sizeof(pps->data))
784 pps->data[pps->data_size++] = 0x80;
786 pps->sps_id = get_ue_golomb_31(gb);
787 if ((unsigned)pps->sps_id >= MAX_SPS_COUNT ||
788 !ps->sps_list[pps->sps_id]) {
789 av_log(avctx, AV_LOG_ERROR, "sps_id %u out of range\n", pps->sps_id);
793 pps->sps_ref = av_buffer_ref(ps->sps_list[pps->sps_id]);
794 if (!pps->sps_ref) {
798 pps->sps = (const SPS*)pps->sps_ref->data;
799 sps = pps->sps;
815 pps->cabac = get_bits1(gb);
816 pps->pic_order_present = get_bits1(gb);
817 pps->slice_group_count = get_ue_golomb(gb) + 1;
818 if (pps->slice_group_count > 1) {
819 pps->mb_slice_group_map_type = get_ue_golomb(gb);
824 pps->ref_count[0] = get_ue_golomb(gb) + 1;
825 pps->ref_count[1] = get_ue_golomb(gb) + 1;
826 if (pps->ref_count[0] - 1 > 32 - 1 || pps->ref_count[1] - 1 > 32 - 1) {
827 av_log(avctx, AV_LOG_ERROR, "reference overflow (pps)\n");
834 pps->weighted_pred = get_bits1(gb);
835 pps->weighted_bipred_idc = get_bits(gb, 2);
836 pps->init_qp = get_se_golomb(gb) + 26U + qp_bd_offset;
837 pps->init_qs = get_se_golomb(gb) + 26U + qp_bd_offset;
838 pps->chroma_qp_index_offset[0] = get_se_golomb(gb);
839 if (pps->chroma_qp_index_offset[0] < -12 || pps->chroma_qp_index_offset[0] > 12) {
844 pps->deblocking_filter_parameters_present = get_bits1(gb);
845 pps->constrained_intra_pred = get_bits1(gb);
846 pps->redundant_pic_cnt_present = get_bits1(gb);
848 pps->transform_8x8_mode = 0;
849 memcpy(pps->scaling_matrix4, sps->scaling_matrix4,
850 sizeof(pps->scaling_matrix4));
851 memcpy(pps->scaling_matrix8, sps->scaling_matrix8,
852 sizeof(pps->scaling_matrix8));
856 pps->transform_8x8_mode = get_bits1(gb);
857 ret = decode_scaling_matrices(gb, sps, pps, 0,
858 pps->scaling_matrix4, pps->scaling_matrix8);
862 pps->chroma_qp_index_offset[1] = get_se_golomb(gb);
863 if (pps->chroma_qp_index_offset[1] < -12 || pps->chroma_qp_index_offset[1] > 12) {
868 pps->chroma_qp_index_offset[1] = pps->chroma_qp_index_offset[0];
871 build_qp_table(pps, 0, pps->chroma_qp_index_offset[0],
873 build_qp_table(pps, 1, pps->chroma_qp_index_offset[1],
876 init_dequant_tables(pps, sps);
878 if (pps->chroma_qp_index_offset[0] != pps->chroma_qp_index_offset[1])
879 pps->chroma_qp_diff = 1;
883 "pps:%u sps:%u %s slice_groups:%d ref:%u/%u %s qp:%d/%d/%d/%d %s %s %s %s\n",
884 pps_id, pps->sps_id,
885 pps->cabac ? "CABAC" : "CAVLC",
886 pps->slice_group_count,
887 pps->ref_count[0], pps->ref_count[1],
888 pps->weighted_pred ? "weighted" : "",
889 pps->init_qp, pps->init_qs, pps->chroma_qp_index_offset[0], pps->chroma_qp_index_offset[1],
890 pps->deblocking_filter_parameters_present ? "LPAR" : "",
891 pps->constrained_intra_pred ? "CONSTR" : "",
892 pps->redundant_pic_cnt_present ? "REDU" : "",
893 pps->transform_8x8_mode ? "8x8DCT" : "");