[XviD-devel] Custom Quantization MPEG-4 compatiblily issue?

suxen_drol xvid-devel@xvid.org
Wed, 15 Jan 2003 21:08:07 +1100


On Sun, 12 Jan 2003 15:00:01 +0100 (CET) Christoph Lampert <chl@math.uni-bonn.de> wrote:

> 
> Hi, 
> 
> I just tried to create a .m4v stream with branch and include this into a
> mp4 file using  mp4creator from the mpeg4ip-package. 
> 
> It failed, when I included a custom matrix with the error: 
> 
> MP4ERROR: MP4WriteCountedString: Numerical result out of range
> 
> 
> Does XVID do this somehow in a non-standard way?

just gave it a try (mp4creator -create=custom.avi custom.mp4), and i
i got a similar error: MP4ERROR: MP4WriteCountedString: Result too large

the error occurs in the following function:
void MP4File::WriteCountedString(char* string, 
	u_int8_t charSize, bool allowExpandedCount)
this writes out a string of bytes. the above error is generated when
allowExpandedCount=false and the charSize (string length) exceeds 255
bytes.

i modified the function to dump the string:

custom.avi(custom mpeg qmatrix): charSize=332 bytes: (VOL=171 bytes)
data:application/mpeg4-od-au;base64,AYCAgVcBgICBUgUfA4CAgUsAAQAEgICBPSARAGBhABXrQAAMNSsFgICBKwAAAbADAAABtQsAAAEAAAABIAAGxABnDEwQgFMIEBAQEBAQEBAQERAREBESERISERIVExQVFBMVGBYWGBgWFhgZGRseGxkZHR8jIx8dGiksKSQvNjYvQUZBWFhzigoKCgoKCgoKCgqKCooKi4sLCwsLjQwMDQwMDQ8NjY8PDY2PEA+REpEPkBITFhYTEhYZnBmWHaIiHaisKLa2yGMAAAGyWHZpRDAwMDh/AAaAgIABAA==

default.avi(default mpeg qmatrix): charSize=160 bytes: (VOL=43 bytes)
data:application/mpeg4-od-au;base64,AYCAgFcBgICAUgUfA4CAgEsAAQAEgICAPSARAFZ4ABjMAAANbdsFgICAKwAAAbADAAABtQsAAAEAAAABIAAGxABnDEwQgFJjAAABslh2aUQwMDA4fwAGgICAAQA=

both .avis are of similar size; so it seems the charSize is relative to
the length of the VOL. thus large VOLs cause mp4creator to fail.

-- pete; life is like a box of ammo