2.6.10 zr36067 driver - correct jpeg app/com markers
PATCH 1/3 2.6.10 zr36067 driver - correct jpeg app/com markers
Hi Linus/Andrew,
Quoted 1 line
From my original message (Sep 2nd, 2004):
"Attached patch fixes the writing of APP (application-specific) and COM (comment) markers in the JPEG stream as generated by the zr36050 or zr36060 encoders, both part of the zr36067 driver. During separating those bits out of the main zoran driver, we accidently removed the interface through which applications can adapt those markers, replacing them by unchangeable (static) markers. Some video formats, particularly Quicktime and AVI, require specific container-specific markers in the stream for interlaced streams. Those markers specify field order and such. The attached patch re-adds this feature so that decoders depending on those container-specific markers for correct playback will work correctly."
Regards,
Ronald
Signature · 1 line
Ronald S. Bultje <[email protected]>
drivers/media/video/videocodec.h +11 -0
@@ -248,6 +248,17 @@u16 Wt, Wa, HStart, HSyncStart, Ht, Ha, VStart; }; +struct jpeg_com_marker { +int len;/* number of usable bytes in data */ +char data[60 ]; +}; + +struct jpeg_app_marker { +int appn;/* number app segment */ +int len;/* number of usable bytes in data */ +char data[60 ]; +}; +struct videocodec {struct module *owner;/* -- filled in by slave device during register -- */
drivers/media/video/zoran_device.c +18 -1
@@ -1033,7 +1033,10 @@switch (mode) { -case BUZ_MODE_MOTION_COMPRESS : +case BUZ_MODE_MOTION_COMPRESS : { +struct jpeg_app_marker app; +struct jpeg_com_marker com; +/* In motion compress mode, the decoder output must be enabled, and * the video bus direction set to input. */
@@ -1043,6 +1046,19 @@/* Take the JPEG codec and the VFE out of sleep */ jpeg_codec_sleep (zr,0 ); + +/* set JPEG app/com marker */ + app.appn = zr->jpg_settings.jpg_comp.APPn; + app.len = zr->jpg_settings.jpg_comp.APP_len; +memcpy (app.data, zr->jpg_settings.jpg_comp.APP_data,60 ); + zr->codec->control (zr->codec,CODEC_S_JPEG_APP_DATA , +sizeof (struct jpeg_app_marker ), &app); + + com.len = zr->jpg_settings.jpg_comp.COM_len; +memcpy (com.data, zr->jpg_settings.jpg_comp.COM_data,60 ); + zr->codec->control (zr->codec,CODEC_S_JPEG_COM_DATA , +sizeof (struct jpeg_com_marker ), &com); +/* Setup the JPEG codec */ zr->codec->control (zr->codec,CODEC_S_JPEG_TDS_BYTE ,sizeof (int ), &field_size);
@@ -1066,6 +1082,7 @@dprintk (2 ,KERN_INFO "%s: enable_jpg(MOTION_COMPRESS)\n" ,ZR_DEVNAME (zr));break ; + }case BUZ_MODE_MOTION_DECOMPRESS :/* In motion decompression mode, the decoder output must be disabled, and
drivers/media/video/zr36050.c +62 -32
124 lines not on this page · raw message
drivers/media/video/zr36050.h +6 -0
@@ -27,6 +27,8 @@ #ifndef ZR36050_H #define ZR36050_H +#include "videocodec.h" + /* data stored for each zoran jpeg codec chip */ struct zr36050 { char name[32];
@@ -51,6 +53,10 @@__u8 v_samp_ratio[8 ];__u16 scalefact;__u16 dri; + +/* com/app marker */ +struct jpeg_com_marker com; +struct jpeg_app_marker app; };/* zr36050 register addresses */
drivers/media/video/zr36060.c +62 -34
126 lines not on this page · raw message
drivers/media/video/zr36060.h +6 -0
@@ -27,6 +27,8 @@ #ifndef ZR36060_H #define ZR36060_H +#include "videocodec.h" + /* data stored for each zoran jpeg codec chip */ struct zr36060 { char name[32];
@@ -51,6 +53,10 @@__u8 v_samp_ratio[8 ];__u16 scalefact;__u16 dri; + +/* app/com marker data */ +struct jpeg_app_marker app; +struct jpeg_com_marker com; };/* ZR36060 register addresses */