[FFmpeg-devel] [PATCH] jpeg2000: split off inverse MCT decoding as Jpeg2000DSP
Michael Niedermayer
michaelni at gmx.at
Thu Oct 2 02:50:58 CEST 2014
On Wed, Oct 01, 2014 at 08:08:18PM -0300, James Almer wrote:
> On 01/10/14 8:04 PM, Michael Niedermayer wrote:
> > On Wed, Oct 01, 2014 at 05:14:38PM -0300, James Almer wrote:
> >> This makes the addition of arch optimized functions easier.
> >>
> >> Signed-off-by: James Almer <jamrial at gmail.com>
> >> ---
> >> libavcodec/Makefile | 2 +-
> >> libavcodec/jpeg2000dec.c | 71 +++++++++--------------------------
> >> libavcodec/jpeg2000dsp.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++
> >> libavcodec/jpeg2000dsp.h | 35 +++++++++++++++++
> >> libavcodec/jpeg2000dwt.h | 3 +-
> >> 5 files changed, 153 insertions(+), 56 deletions(-)
> >> create mode 100644 libavcodec/jpeg2000dsp.c
> >> create mode 100644 libavcodec/jpeg2000dsp.h
> > [...]
> >> +static void mct_decode97_float(void *_src0, void *_src1, void *_src2, int csize)
> >> +{
> >> + float *src0 = _src0, *src1 = _src1, *src2 = _src2;
> >> + float i0f, i1f, i2f;
> >> + int i;
> >> +
> >> + for (i = 0; i < csize; i++) {
> >> + i0f = *src0 + (f_ict_params[0] * *src2);
> >> + i1f = *src0 - (f_ict_params[1] * *src1)
> >> + - (f_ict_params[2] * *src2);
> >> + i2f = *src0 + (f_ict_params[3] * *src1);
> >> + *src0++ = i0f;
> >> + *src1++ = i1f;
> >> + *src2++ = i2f;
> >> + }
> >> +}
> >> +
> >> +static void mct_decode97_int(void *_src0, void *_src1, void *_src2, int csize)
> >> +{
> >> + int32_t *src0 = _src0, *src1 = _src1, *src2 = _src2;
> >> + int32_t i0, i1, i2;
> >> + int i;
> >> +
> >> + for (i = 0; i < csize; i++) {
> >> + i0 = *src0 + (((i_ict_params[0] * *src2) + (1 << 15)) >> 16);
> >> + i1 = *src0 - (((i_ict_params[1] * *src1) + (1 << 15)) >> 16)
> >> + - (((i_ict_params[2] * *src2) + (1 << 15)) >> 16);
> >> + i2 = *src0 + (((i_ict_params[3] * *src1) + (1 << 15)) >> 16);
> >> + *src0++ = i0;
> >> + *src1++ = i1;
> >> + *src2++ = i2;
> >> + }
> >> +}
> >> +
> >> +static void mct_decode53(void *_src0, void *_src1, void *_src2, int csize)
> >
> > the function names are not good
> > the code is not related to the 5/3 and 9/7 wavelets
>
> Well, the code checks for one of the three DWTType values (FF_DWT97, FF_DWT97_INT and
> FF_DWT53) to choose what to run, so these names seemed adequate to me.
>
> What names do you suggest then?
the terms used by jpeg2000 are rct and ict, for
Reversible multiple component transformation (RCT)
and
Irreversible multiple component transformation (ICT)
we have 2 implementations of the ICT, one float and one int
so id suggest
ict_float, ict_int, rct_int
maybe throwing a f/i in for forward and inverse, maybe instead not
abbreviating something, i dunno, pick what you prefer
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141002/41dc64d4/attachment.asc>
More information about the ffmpeg-devel
mailing list