When the 'raw ' compression scheme is used and color model
conversion is not necessary, quicktime_encode_video() in
quicktime4linux-1.6.2 assumes that row_pointers points to
the start of a contiguous block to encode; the other elements
of row_pointers are ignored. The attached patch changes raw.c
to handle other layouts of the rows to encode.
One unresolved question I have is the use of
cmodel_calculate_datasize() in both the original and patched
raw.c. For the ARG8888 or RGB888 color model,
cmodel_calculate_datasize() returns a size 4 bytes larger than
the product of the number of rows, number of columns,
and the pixel size. The original raw.c assumes that the block
of memory to encode includes those additional 4 bytes and
writes those bytes to the file. The patched raw.c has the same
behavior as the original when the elements of row_pointers are
sequential with row_pointers pointing to the start of the block.
When the elements of row_pointers are not sequential, the
patched raw.c also writes the additional bytes specified by
cmodel_calculate_datasize() but does not assume they are
included in the data pointed to by row_pointers.