Francesco Potorti` Potorti at isti.cnr.it
Mon Aug 4 03:21:30 CDT 2008


Your code does not look like it should be slow.  Just some small
possible improvements (all untested):

>    ycbcr(:,:,1) = y;
>    ycbcr(:,:,2) = cb;
>    ycbcr(:,:,3) = cr;

This could be slightly faster:
  ycbcr = cat(3,y,cb,cr);
Or even:
  ycbcr = reshape([y(:);cb(:);cr(:)],[size(y) 3]);

or reverse the order of assignments, like Søren suggested.

>yn(find(yn < 0)) = 0;

This can be rewrote more simply:
  yn(yn < 0) = 0;

and the others as well.

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: Potorti at isti.cnr.it
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


More information about the Help-octave mailing list