[FFmpeg-devel] [PATCH] DNxHD 10-bit support v5

Michael Niedermayer michaelni at gmx.at
Sat Jun 11 02:05:29 CEST 2011


On Sat, Jun 11, 2011 at 01:57:01AM +0200, Michael Niedermayer wrote:
> On Thu, Jun 09, 2011 at 02:18:29PM +0000, Joseph Artsimovich wrote:
> > Hi,
> > 
> > After being distracted by other things for a while, I am back trying to get my 10-bit DNxHD patches accepted.
> > I've prepared a new version of my patches.  This one is much less intrusive than the previous ones.  In particular, it touches neither MpegEncContext nor DSPContext.  Please review.
> > 
> > Apply the renaming patch first, then the other one.
> [...]
> 
> > +static int dnxhd_10bit_dct_quantize(struct DNXHDEncContext *ctx, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow)
> > +{
> > +    const uint8_t *scantable= ctx->m.intra_scantable.scantable;
> > +    const int *qmat = ctx->m.q_intra_matrix[qscale];
> > +    int last_non_zero = 0;
> > +
> > +    ff_faandct_10bit_safe(block);
> > +
> > +    // Divide by 4 with rounding, to compensate scaling of DCT coefficients done by ff_faandct_10bit_safe().
> > +    block[0] = (block[0] + 2) >> 2;
> > +
> > +    for (int i = 1; i < 64; ++i) {
> > +        int j = scantable[i];
> > +        int unquantized = block[j];
> > +        int quantized = abs(unquantized * qmat[j]) >> DNX10BIT_QMAT_SHIFT;
> > +        if (unquantized < 0) {
> > +            quantized = -quantized;
> > +        }
> 
> it might make sense to do the abs first then check against a threshold
> so the multiply & shift is only done when the value isnt going to be
> 0 anyway. 0 is the most common value
> so this may be faster

also switching to 10 bit PIXFMT as baptiste suggested could be done

But none of these things should cause the patch to be delayed for
months. the regression test failure must be fixed though
That is, if you prefer to work on the rest later iam in favor of
applying (as i planed) once the regression is fixed / explained


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110611/c98e6d1b/attachment.asc>


More information about the ffmpeg-devel mailing list