mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
HEVC: decode: Replace clip3 implementation with glib CLAMP macro
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
This commit is contained in:
parent
8762b04a19
commit
78fb4bcf8d
1 changed files with 6 additions and 15 deletions
|
@ -2297,16 +2297,6 @@ get_slice_data_byte_offset (GstH265SliceHdr * slice_hdr, guint nal_header_bytes)
|
||||||
return nal_header_bytes + (slice_hdr->header_size + 7) / 8 - epb_count;
|
return nal_header_bytes + (slice_hdr->header_size + 7) / 8 - epb_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
|
||||||
clip3 (gint x, gint y, gint z)
|
|
||||||
{
|
|
||||||
if (z < x)
|
|
||||||
return x;
|
|
||||||
if (z > y)
|
|
||||||
return y;
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
fill_pred_weight_table (GstVaapiDecoderH265 * decoder,
|
fill_pred_weight_table (GstVaapiDecoderH265 * decoder,
|
||||||
GstVaapiSlice * slice, GstH265SliceHdr * slice_hdr)
|
GstVaapiSlice * slice, GstH265SliceHdr * slice_hdr)
|
||||||
|
@ -2346,9 +2336,10 @@ fill_pred_weight_table (GstVaapiDecoderH265 * decoder,
|
||||||
chroma_weight =
|
chroma_weight =
|
||||||
(1 << chroma_log2_weight_denom) + w->delta_chroma_weight_l0[i][j];
|
(1 << chroma_log2_weight_denom) + w->delta_chroma_weight_l0[i][j];
|
||||||
/* 7-44 */
|
/* 7-44 */
|
||||||
slice_param->ChromaOffsetL0[i][j] = clip3 (-128, 127,
|
slice_param->ChromaOffsetL0[i][j] = CLAMP (
|
||||||
(w->delta_chroma_offset_l0[i][j] -
|
(w->delta_chroma_offset_l0[i][j] -
|
||||||
((128 * chroma_weight) >> chroma_log2_weight_denom)));
|
((128 * chroma_weight) >> chroma_log2_weight_denom)), -128,
|
||||||
|
127);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2368,9 +2359,9 @@ fill_pred_weight_table (GstVaapiDecoderH265 * decoder,
|
||||||
(1 << chroma_log2_weight_denom) +
|
(1 << chroma_log2_weight_denom) +
|
||||||
w->delta_chroma_weight_l1[i][j];
|
w->delta_chroma_weight_l1[i][j];
|
||||||
slice_param->ChromaOffsetL1[i][j] =
|
slice_param->ChromaOffsetL1[i][j] =
|
||||||
clip3 (-128, 127,
|
CLAMP ((w->delta_chroma_offset_l1[i][j] -
|
||||||
(w->delta_chroma_offset_l1[i][j] -
|
((128 * chroma_weight) >> chroma_log2_weight_denom)), -128,
|
||||||
((128 * chroma_weight) >> chroma_log2_weight_denom)));
|
127);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue