octave-maintainers
[Top][All Lists]
Advanced

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

Re: reading jpegs faster


From: David Grundberg
Subject: Re: reading jpegs faster
Date: Wed, 10 Feb 2010 10:23:41 +0100
User-agent: Thunderbird 2.0.0.23 (X11/20090812)

David Grundberg wrote:
David Grundberg wrote:
John W. Eaton wrote:
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

Thanks for the hint. I've been thinking on how to do that.

David


The attached changeset implements fortran_vec pointer arithmetics for all non-paletted images.

David

I pushed a changeset

http://hg.savannah.gnu.org/hgweb/octave/rev/13d382fc758b

David


reply via email to

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