[codec-devel] Re: Help needed

View: New views
4 Messages — Rating Filter:   Alert me  

[codec-devel] Re: Help needed

by Kostya-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've more or less understood their logic. Their intra blocks follow such
scheme:
            LAST 4 ELEMENTS
             V       V       V      V
D0 -> +d00 +d10 +d20 +d30 -> D0
D1 -> +d01 +d11 +d21 +d31 -> D1
D2 -> +d02 +d12 +d22 +d32 -> D2
D3 -> +d03 +d13 +d23 +d33 -> D3
             V       V       V      V
           LAST 4 ELEMENTS
where D0-D3 - saved deltas, dxy - new delta for position x,y (note that
+d00 +d10 means D0 += d00; D0 += d10; and the same for LAST 4 ELEMENTS)

Inter blocks (still, motion, update) also update deltas D0-D3 and LAST4,
but somehow in another way.

Now my decoder decodes file tm20.avi from MPlayer samples repository
with artifacts and in grayscale only, but nevertheless close to original.

Can somebody review this code and suggest how to correct and/or some
optimise it?

P.S. I noted that even if I don't get helpful replies, my work goes
better after such posts. Maybe it's time to open local BLOG :)


truemotion2.c.gz (6K) Download Attachment

Re: [codec-devel] Re: Help needed

by Mike Melanson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kostya wrote:

> I've more or less understood their logic. Their intra blocks follow such
> scheme:
>            LAST 4 ELEMENTS
>             V       V       V      V
> D0 -> +d00 +d10 +d20 +d30 -> D0
> D1 -> +d01 +d11 +d21 +d31 -> D1
> D2 -> +d02 +d12 +d22 +d32 -> D2
> D3 -> +d03 +d13 +d23 +d33 -> D3
>             V       V       V      V
>           LAST 4 ELEMENTS
> where D0-D3 - saved deltas, dxy - new delta for position x,y (note that
> +d00 +d10 means D0 += d00; D0 += d10; and the same for LAST 4 ELEMENTS)

        Reminds me a lot of TM1.

> Inter blocks (still, motion, update) also update deltas D0-D3 and LAST4,
> but somehow in another way.
>
> Now my decoder decodes file tm20.avi from MPlayer samples repository
> with artifacts and in grayscale only, but nevertheless close to original.

        Good work. However, the real prize will be if you can figure out the
custom TM2 variant used in the PC version of Final Fantasy VII.

> Can somebody review this code and suggest how to correct and/or some
> optimise it?
>
> P.S. I noted that even if I don't get helpful replies, my work goes
> better after such posts. Maybe it's time to open local BLOG :)

        That can be arranged...
--
        -Mike Melanson


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
xine-codec-devel mailing list
xine-codec-devel@...
https://lists.sourceforge.net/lists/listinfo/xine-codec-devel

Parent Message unknown Re: [codec-devel] Re: Help needed

by Kostya-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mike Melanson wrote:

> Reminds me a lot of TM1.
>
>  
>
VP3 without DCT too.

>>Inter blocks (still, motion, update) also update deltas D0-D3 and LAST4,
>>but somehow in another way.
>>
>>Now my decoder decodes file tm20.avi from MPlayer samples repository
>>with artifacts and in grayscale only, but nevertheless close to original.
>>    
>>
>
> Good work. However, the real prize will be if you can figure out the
>custom TM2 variant used in the PC version of Final Fantasy VII.
>  
>
That sample from mplayerhq looks to me like Final Fantasy intro.


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
xine-codec-devel mailing list
xine-codec-devel@...
https://lists.sourceforge.net/lists/listinfo/xine-codec-devel

Re: [codec-devel] Re: Help needed

by Michael Niedermayer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

On Mon, Sep 05, 2005 at 07:08:00PM +0300, Kostya wrote:

> I've more or less understood their logic. Their intra blocks follow such
> scheme:
>            LAST 4 ELEMENTS
>             V       V       V      V
> D0 -> +d00 +d10 +d20 +d30 -> D0
> D1 -> +d01 +d11 +d21 +d31 -> D1
> D2 -> +d02 +d12 +d22 +d32 -> D2
> D3 -> +d03 +d13 +d23 +d33 -> D3
>             V       V       V      V
>           LAST 4 ELEMENTS
> where D0-D3 - saved deltas, dxy - new delta for position x,y (note that
> +d00 +d10 means D0 += d00; D0 += d10; and the same for LAST 4 ELEMENTS)
>
> Inter blocks (still, motion, update) also update deltas D0-D3 and LAST4,
> but somehow in another way.
>
> Now my decoder decodes file tm20.avi from MPlayer samples repository
> with artifacts and in grayscale only, but nevertheless close to original.
>
> Can somebody review this code and suggest how to correct and/or some
> optimise it?

well, i just took a quick look at the code (didnt compile or test it ...)
here is what i noticed


get_bits() is limited to a max of MIN_CACHE_BITS which is 25 with the
default bitstream reader and may be as low as 17 with others, i saw
some cases which read more, they should use get_bits_long()

the comments for structure fields should be in doxygen compatible format
(/** ... */ before or ///< after the field, or see the doxy manual there
are other variants too)


>     toks = BE_32(buf); buf += 4; cur += 4;
[...]
>     toks >>= 1;
>     ctx->tokens[stream_id] = av_realloc(ctx->tokens[stream_id], toks * sizeof(int));
[...]
> for(i = 0; i < toks; i++)
>        ctx->tokens[stream_id][i] = tm2_get_token(&ctx->gb, &codes);

looks bad, toks * sizeof(int) can overflow so that the allocated memory is
too small for the later for loop

[...]

--
Michael


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
xine-codec-devel mailing list
xine-codec-devel@...
https://lists.sourceforge.net/lists/listinfo/xine-codec-devel
LightInTheBox - Buy quality products at wholesale price!