Commit 887c0269 authored by Luc Trudeau's avatar Luc Trudeau
Browse files

Fix negative shift exponent in get_poc_diff

As indicated in the spec, get_poc_diff should return 0 when
order_hints are disabled.

Closes #77
parent 5186abdb
Pipeline #1223 passed with stage
in 2 minutes
......@@ -293,6 +293,7 @@ static inline int get_comp_dir_ctx(const BlockContext *const a,
static inline int get_poc_diff(const int order_hint_n_bits,
const int poc0, const int poc1)
{
if (!order_hint_n_bits) return 0;
const int mask = 1 << (order_hint_n_bits - 1);
const int diff = poc0 - poc1;
return (diff & (mask - 1)) - (diff & mask);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment