View Issue Details

IDProjectCategoryView StatusLast Update
0000119JVT JM H.264/AVC reference softwareencoderpublic2008-08-05 21:24
Reporterbehdad analui Assigned ToAlexis Michael Tourapis  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionJM-14.1 
Fixed in VersionJM 14.2 
Summary0000119: Wrong codeword and codelength are generated for levels greater than 2063, when encoding level in CAVLC
DescriptionWhile encoding a level, for both "suffixLength"=0 and "suffixLength">0, the generated codeword is not valid in some cases. Function "writeSyntaxElement_Level_VLC1" and "writeSyntaxElement_Level_VLCN" which are implemented in file "vlc.c", for levels greater than 2063, produce wrong codewords.
The problem is that the original source code (JM14.1) does not subtract the "offset" value from the "levabsm16", when setting the "iCodeword" in "writeSyntaxElement_Level_VLC1" function. So it does not take full advantage from the suffix bits, therefore overflow occurs and destroy the codeword.
In addition, while loop condition of both functions are wrong according to the H.264 Standard 2005, and 4096 should be changed to 2048. In this way both functions works properly for all kind of levels.
We can provide more information and mathematical relations according to the standard to prove that our modification is correct upon your request.
Additional InformationA *.rar file has been uploaded, which contains 3 files.
"Bug_Report_Examples.xls" contains some examples that wrong codeword is produced using original code, and correct codewords are produced using our proposed code. using examples of this file, you can reproduce the problem.
"Original Code.txt" contains the original code functions that should be modified.
"ourCode.txt" contains the modified functions that works properly.
it seems that the problem only occurs when inputs are larger than 8 bits.( 10 bits for example)

TagsNo tags attached.

Activities

2008-07-27 08:12

 

Bug_report.rar (7,205 bytes)

Alexis Michael Tourapis

2008-08-05 21:24

developer   ~0000214

Proposed patch added and further cleaned up to improve encoding performance.

Issue History

Date Modified Username Field Change
2008-07-27 08:12 behdad analui New Issue
2008-07-27 08:12 behdad analui File Added: Bug_report.rar
2008-08-05 21:24 Alexis Michael Tourapis Note Added: 0000214
2008-08-05 21:24 Alexis Michael Tourapis Status new => resolved
2008-08-05 21:24 Alexis Michael Tourapis Fixed in Version => JM 14.1-dev
2008-08-05 21:24 Alexis Michael Tourapis Resolution open => fixed
2008-08-05 21:24 Alexis Michael Tourapis Assigned To => Alexis Michael Tourapis