[sane-devel] proposel for buffer size increase frontends scanimage ..
On Tuesday 18 January 2005 18:19, Johannes Berg wrote: gerard klaver schrieb: In this way the write cycle in sane_read will be reduced and is it possible to write a image from for example a 640 x 480 webcam in one cycle to the frontend buffer. What's the advantage? If there really is an advantage, I think it should probably be made dynamic instead. Using this much space on the stack isn't really a good thing IMHO. That would be my comment too. 1Mib on the stack - hmmm, I don't like this idea. If we really need such an amount of mem, use malloc! My 2 cents Gerhard
[sane-devel] proposel for buffer size increase frontends scanimage ..
On Wed, 2005-01-19 at 08:31 +0100, Gerhard Jaeger wrote: On Tuesday 18 January 2005 18:19, Johannes Berg wrote: gerard klaver schrieb: In this way the write cycle in sane_read will be reduced and is it possible to write a image from for example a 640 x 480 webcam in one cycle to the frontend buffer. What's the advantage? If there really is an advantage, I think it should probably be made dynamic instead. Using this much space on the stack isn't really a good thing IMHO. That would be my comment too. 1Mib on the stack - hmmm, I don't like this idea. If we really need such an amount of mem, use malloc! My 2 cents Gerhard IFAIK in the backend as in the frontend more and/or bigger buffers are used in general to do color correction, line skew correction etc. The idea of making it dynamic sounds good to me. How this should be done, i don't know yet. If somebody else has an idea, please let me know. I think it should be something like: Frontends defines a max. buffer value ( for example 1024 * 1024, default value is old value 32 * 1024) Backends defines a value ( for example 256 * 1024) if no backend value is present default value frontend will be used (so no existing backend is affected). if backend value max. frontend value, backend value will be used if backend value = max. frontend value, frontend value will be used -- m.vr.gr. Gerard Klaver
[sane-devel] proposel for buffer size increase frontends scanimage ..
--=-G2Ge2qX71EHeEV2nS+0H Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, Proposal to increase the buffersize of buffer[32 * 1024] to buffer[1024 * 1024] for frontend scanimage for diff zie attachment. In this way the write cycle in sane_read will be reduced and is it possible to write a image from for example a 640 x 480 webcam in one cycle to the frontend buffer. For other frontends its the same but i tested only xscanimage at this moment (patch (with other patches) is in sane/experimental but needs a update) For: saned ?? scanadf ?? Others ?? Any comments? -- m.vr.gr. Gerard Klaver --=-G2Ge2qX71EHeEV2nS+0H Content-Disposition: attachment; filename=scanimage.diff Content-Type: text/x-patch; name=scanimage.diff; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit --- scanimage-orig.c2005-01-18 17:33:20.0 +0100 +++ scanimage.c 2005-01-18 17:34:03.0 +0100 @@ -1020,7 +1020,7 @@ scan_it (void) { int i, len, first_frame = 1, offset = 0, must_buffer = 0; - SANE_Byte buffer[32 * 1024], min = 0xff, max = 0; + SANE_Byte buffer[1024 * 1024], min = 0xff, max = 0; SANE_Parameters parm; SANE_Status status; Image image = { 0, 0, 0, 0, 0, 0 }; --=-G2Ge2qX71EHeEV2nS+0H--
[sane-devel] proposel for buffer size increase frontends scanimage ..
gerard klaver schrieb: In this way the write cycle in sane_read will be reduced and is it possible to write a image from for example a 640 x 480 webcam in one cycle to the frontend buffer. What's the advantage? If there really is an advantage, I think it should probably be made dynamic instead. Using this much space on the stack isn't really a good thing IMHO. johannes