| CPC H04N 19/46 (2014.11) [H04N 19/176 (2014.11)] | 17 Claims |

|
1. A coefficient decoding method, applied to a decoder and comprising:
parsing a bitstream to obtain a sequence level flag;
parsing the bitstream to obtain a last-significant-coefficient position-reverse flag when the sequence level flag indicates that a video satisfies a preset condition;
parsing the bitstream to obtain prefix information of a horizontal coordinate of a last significant coefficient, prefix information of a vertical coordinate of the last significant coefficient, suffix information of the horizontal coordinate of the last significant coefficient, and suffix information of the vertical coordinate of the last significant coefficient;
determining the horizontal coordinate of the last significant coefficient according to the prefix information of the horizontal coordinate of the last significant coefficient and the suffix information of the horizontal coordinate of the last significant coefficient;
determining the vertical coordinate of the last significant coefficient according to the prefix information of the vertical coordinate of the last significant coefficient and the suffix information of the vertical coordinate of the last significant coefficient; and
determining coordinate information of the last significant coefficient according to the horizontal coordinate of the last significant coefficient and the vertical coordinate of the last significant coefficient;
determining a position of the last significant coefficient by calculation with the coordinate information of the last significant coefficient when the last-significant-coefficient position-reverse flag indicates that the position of the last significant coefficient is reversed for a current block; and
decoding, according to a preset scanning order, all coefficients before the position of the last significant coefficient to determine coefficients of the current block,
wherein a value of the horizontal coordinate of the last significant coefficient in the preset scanning order within the current block is derived as follows:
if last_sig_coeff_x_suffix is not present, then:
LastSignificantCoeffX=last_sig_coeff_x_prefix;
if last_sig_coeff_x_suffix is present, then:
LastSignificantCoeffX=(1<<((last_sig_coeff_x_prefix>>1)−1))*(2+(last_sig_coeff_x_prefix&1))+last_sig_coeff_x_suffix; and
if reverse_last_sig_coeff_flag is equal to 1, then:
LastSignificantCoeffX=(1<<log 2ZoTbWidth)−1−LastSignificantCoeffX; and
a value of the vertical coordinate of the last significant coefficient in the preset scanning order within the current block is derived as follows:
if last_sig_coeff_y_suffix is not present, then:
LastSignificantCoeffY=last_sig_coeff_y_prefix;
if last_sig_coeff_y_suffix is present, then:
LastSignificantCoeffY=(1<<((last_sig_coeff_y_prefix>>1)−1))*(2+(last_sig_coeff_y_prefix&1))+last_sig_coeff_y_suffix; and
if reverse_last_sig_coeff_flag is equal to 1, then:
LastSignificantCoeffY=(1<<log 2ZoTbHeight)−1−LastSignificantCoeffY;
wherein LastSignificantCoeffX represents the value of the horizontal coordinate of the last significant coefficient in the preset scanning order within the current block, LastSignificantCoeffY represents the value of the vertical coordinate of the last significant coefficient in the preset scanning order within the current block, last_sig_coeff_x_prefix represents the prefix information of the horizontal coordinate of the last significant coefficient, last_sig_coeff_y_prefix represents the prefix information of the vertical coordinate of the last significant coefficient, last_sig_coeff_x_suffix represents the suffix information of the horizontal coordinate of the last significant coefficient, the last_sig_coeff_y_suffix represents suffix information of the vertical coordinate of the last significant coefficient, and reverse_last_sig_coeff_flag represents the last-significant-coefficient position-reverse flag.
|