[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reading jpegs faster
From: |
John W. Eaton |
Subject: |
Re: reading jpegs faster |
Date: |
Fri, 22 Jan 2010 17:06:48 -0500 |
On 22-Jan-2010, David Grundberg wrote:
| Okay. Now I got it down to 1.3 seconds. That's 130% compared to the
| jpgread performance, instead of the previous 900%. Needs polish, but it
| works.
Thanks for looking at this problem.
| + P *vec = reinterpret_cast<P *> (im.fortran_vec ());
I don't think this cast is needed, given that P appears to always be
the same as the element type of IM. So you could use the element_type
typedef from the class T and eliminate the template parameter P:
template <class T, unsigned int D>
octave_value_list
read_images (const std::vector<Magick::Image>& imvec,
const Array<int>& frameidx, unsigned int depth)
{
octave_value_list retval (3, Matrix ());
T im;
typedef typename T::element_type P;
...
P *vec = im.fortran_vec ();
...
case 1:
output = read_images<boolNDArray, 1> (imvec, frameidx, depth);
break;
...
jwe