help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:


From: Francesco Potorti`
Subject: Re:
Date: Mon, 04 Aug 2008 10:21:30 +0200

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: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]