Opened 12 years ago Closed 12 years ago #1076 closed defect (duplicate)Encoder generates a non-conforming bitstream by encoding a coefficient level of +32768 when sign hiding is enabled
Description
I encountered a case where the encoder generated a bitstream containing a +32768 coefficient level when sign hiding is enabled. if(piQCoef[minPos] == 32767 || piQCoef[minPos] == -32768) { finalChange = -1; } if(plSrcCoeff[minPos]>=0) { piDstCoeff[minPos] += finalChange ; } else { piDstCoeff[minPos] -= finalChange ; }
Adding a printf after the first 'if' block:
printf("xRateDistOptQuant: minPos=%d plSrcCoeff[minPos]=%d piQCoef[minPos]=%d piDstCoeff[minPos]=%d finalChange=%d\n", minPos, plSrcCoeff[minPos], piQCoef[minPos], piDstCoeff[minPos], finalChange);
I got the following output (for a DC coefficient):
xRateDistOptQuant: minPos=0 plSrcCoeff[minPos]=20059 piQCoef[minPos]=124277 piDstCoeff[minPos]=32767 finalChange=1
As a result, the second 'if' adjusted the coefficient level to +32768 which got placed into the bitstream.
Two possible solutions:
Change History (3)comment:1 Changed 12 years ago by DefaultCC Plugin
comment:2 Changed 12 years ago by wangjcomment:3 Changed 12 years ago by ksuehring
Closed as duplicate of #1027. Note: See
TracTickets for help on using
tickets. | This list contains all users that will be notified about changes made to this ticket. These roles will be notified: Reporter, Owner, Subscriber, Participant
|
This issue was reported in ticket #1027. Please refer to the patch provided for ticket #1026, which solves both this issue and the problem in ticket #1026. The solution provided in the patch is the suggested solution 2.