Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Test Thread: Internal Huffyuv Decoder, I wrote my own
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
phaeron
Posted: Jun 3 2008, 07:17 AM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Anyone got some weirdly encoded Huffyuv videos to test?

http://www.virtualdub.org/beta/VirtualDub-....8.X2-test2.zip
http://www.virtualdub.org/beta/VirtualDub-...test2-AMD64.zip
http://www.virtualdub.org/beta/VirtualDub-...X2-test2-src.7z

This version contains an internal Huffyuv decoder. It's designed to handle vanilla 2.1.1 encoded files as well as those that use ffmpeg extensions (YV12 and adaptive Huffman). It's a bit less optimized and is probably a bit slower than the stock decoder, but the differences are that this decoder is also fully functional in the 64-bit build and it does full checking in both the Huffman tree and bitstream decoders.

If you already have a Huffyuv decoder installed, enable the internal video decoders in Options > Preferences > AVI to use the built-in one.

I'd be interested if someone has a video which doesn't decode properly or if they're able to crash the decoder with a malformed file.
 
    Top
stephanV
Posted: Jun 3 2008, 07:26 AM


Spam killer ;)


Group: Moderators
Posts: 4348
Member No.: 8917
Joined: 18-February 04



With ffdshow Huffyuv, YV12, Plane, adaptive tables after about 8 frames I'm getting

CODE
Error decompressing frame xx: Internal error: Insufficient space for Huffman decoding tables

for the rest of the frames.

[EDIT]
It seems it only happens with adaptive tables.

--------------------
useful links:
VirtualDub, Input plugins and filters, AviSynth, AVI-Mux GUI, AC3ACM by fcchandler, VirtualDub FAQ
 
    Top
phaeron
Posted: Jun 4 2008, 05:51 AM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Eeeeenteresting. I don't suppose you can post a 1-frame sample somewhere?

The error in question has to do with the amount of space required for the decoding tables -- specifically, it has to do with the maximum length of code that can be encountered with each leading '1' bit position. I had assumed that this couldn't exceed 2x, but apparently I was wrong.
 
    Top
stephanV
Posted: Jun 4 2008, 06:41 AM


Spam killer ;)


Group: Moderators
Posts: 4348
Member No.: 8917
Joined: 18-February 04



http://s000.tinyupload.com/index.php?file_...896445&gk=forex (1.3 MB, 20 frames)

It seems that the decoding error *always* starts at frame 7 of a compressed file. The same frames stay undecodable (is that a word?) though if you cut that file with DSC afterwards.

Another thing: I also I got this crash when trying to save a selection (using ffdshow to compress) on a non-zero starting point.

CODE
VirtualDub crash report -- build 29837 (release)
--------------------------------------

Disassembly:
0056aa40: 6aff            push   0ffh
0056aa42: 68d8cb5a00      push   005acbd8 (RtlUnwind@16+db5c)
0056aa47: 64a100000000    mov    eax, fs:[00000000]
0056aa4d: 50              push   eax
0056aa4e: 64892500000000  mov    fs:[00000000], esp
0056aa55: 83ec6c          sub    esp, 6ch
0056aa58: 53              push   ebx
0056aa59: 55              push   ebp
0056aa5a: 56              push   esi
0056aa5b: 8bf1            mov    esi, ecx
0056aa5d: 8b4634          mov    eax, [esi+34h]
0056aa60: 33db            xor    ebx, ebx
0056aa62: 33ed            xor    ebp, ebp
0056aa64: 385e4c          cmp    [esi+4ch], bl
0056aa67: 57              push   edi
0056aa68: 895c2418        mov    [esp+18h], ebx
0056aa6c: c744241c010000  mov    dword ptr [esp+1ch], 00000001
         00              
0056aa74: 8944242c        mov    [esp+2ch], eax
0056aa78: 885e4d          mov    [esi+4dh], bl
0056aa7b: 7525            jnz    0056aaa2 (VDVideoCompressorVCM::CompressFrame+62)
0056aa7d: 8b4e28          mov    ecx, [esi+28h]
0056aa80: 3bcb            cmp    ecx, ebx
0056aa82: 750b            jnz    0056aa8f (VDVideoCompressorVCM::CompressFrame+4f)
0056aa84: 395e24          cmp    [esi+24h], ebx
0056aa87: 7419            jz     0056aaa2 (VDVideoCompressorVCM::CompressFrame+62)
0056aa89: 895c241c        mov    [esp+1ch], ebx
0056aa8d: eb13            jmp    0056aaa2 (VDVideoCompressorVCM::CompressFrame+62)
0056aa8f: 83c0ff          add    eax, 0ffh
0056aa92: 3bc3            cmp    eax, ebx
0056aa94: 894634          mov    [esi+34h], eax
0056aa97: 7406            jz     0056aa9f (VDVideoCompressorVCM::CompressFrame+5f)
0056aa99: 895c241c        mov    [esp+1ch], ebx
0056aa9d: eb03            jmp    0056aaa2 (VDVideoCompressorVCM::CompressFrame+62)
0056aa9f: 894e34          mov    [esi+34h], ecx
0056aaa2: 8b4e38          mov    ecx, [esi+38h]
0056aaa5: 3bcb            cmp    ecx, ebx
0056aaa7: 7412            jz     0056aabb (VDVideoCompressorVCM::CompressFrame+7b)
0056aaa9: 8b6e44          mov    ebp, [esi+44h]
0056aaac: c1fd02          sar    ebp, 02h
0056aaaf: 8bc1            mov    eax, ecx
0056aab1: 03e9            add    ebp, ecx
0056aab3: d1f8            sar    eax, 1
0056aab5: 3be8            cmp    ebp, eax
0056aab7: 7d02            jge    0056aabb (VDVideoCompressorVCM::CompressFrame+7b)
0056aab9: 8be8            mov    ebp, eax
0056aabb: 3bcb            cmp    ecx, ebx
0056aabd: 8bbc2490000000  mov    edi, [esp+90]
0056aac4: 8a07            mov    al, [edi]      <-- FAULT
0056aac6: 88442413        mov    [esp+13h], al
0056aaca: 0f84a1020000    jz     0056ad71 (VDVideoCompressorVCM::CompressFrame+331)
0056aad0: f6460802        test   [esi+08h], 02h
0056aad4: 0f8597020000    jnz    0056ad71 (VDVideoCompressorVCM::CompressFrame+331)
0056aada: b867666666      mov    eax, 66666667
0056aadf: f7e9            imul   eax, ecx
0056aae1: c1fa03          sar    edx, 03h
0056aae4: 8bca            mov    ecx, edx
0056aae6: c1e91f          shr    ecx, 1fh
0056aae9: 8d540a01        lea    edx, [edx+ecx+01h]
0056aaed: 8d442414        lea    eax, [esp+14h]
0056aaf1: 50              push   eax
0056aaf2: 8b4654          mov    eax, [esi+54h]
0056aaf5: 8d4c241c        lea    ecx, [esp+1ch]
0056aaf9: 51              push   ecx
0056aafa: 89542428        mov    [esp+28h], edx
0056aafe: 8b542424        mov    edx, [esp+24h]
0056ab02: 52              push   edx
0056ab03: 57              push   edi
0056ab04: 50              push   eax
0056ab05: 53              push   ebx
0056ab06: 8b9c24a4000000  mov    ebx, [esp+a4]
0056ab0d: 53              push   ebx
0056ab0e: 8bce            mov    ecx, esi
0056ab10: e81bf7ffff      call   0056a230 (VDVideoCompressorVCM::PackFrameInternal)
0056ab15: 8b4c2414        mov    ecx, [esp+14h]
0056ab19: 8bc1            mov    eax, ecx
0056ab1b: 2bc5            sub    eax, ebp
0056ab1d: 99              cdq    
0056ab1e: 33c2            xor    eax, edx
0056ab20: 2bc2            sub    eax, edx
0056ab22: 3b442420        cmp    eax, [esp+20h]
0056ab26: 0f8e70020000    jle    0056ad9c (VDVideoCompressorVCM::CompressFrame+35c)
0056ab2c: 837c241c00      cmp    dword ptr [esp+1ch], 00h
0056ab31: 0f8565020000    jnz    0056ad9c (VDVideoCompressorVCM::CompressFrame+35c)
0056ab37: 3bcd            cmp    ecx, ebp
0056ab39: 0f8d1e010000    jge    0056ac5d (VDVideoCompressorVCM::CompressFrame+21d)
0056ab3f: 8b              db     8bh

Built on Aegis on Tue Jun 03 00:01:06 2008 using compiler version 1400

Windows 6.0 (Windows Vista x86 build 6001) [Service Pack 1]

EAX = 00000001
EBX = 00000000
ECX = 00000000
EDX = 0056aa40
EBP = 00000000
ESI = 0601ce08
EDI = 00000000
ESP = 0579fc88
EIP = 0056aac4
EFLAGS = 00010246
FPUCW = ffff027f
FPUTW = ffffffff

Crash reason: Access Violation

Crash context:
An out-of-bounds memory access (access violation) occurred in module 'VirtualDub'...

...reading address 00000000...

...while running thread "Processing" (thread.cpp:159).

Pointer dumps:

EDX   0056aa40: d868ff6a 64005acb 000000a1 89645000 00000025 6cec8300 8b565553 34468bf1
ESI   0601ce08: 005e502c 6f2adadc 000000a8 00000000 00000028 002b7808 00000074 0601edf0
ESP   0579fc88: 01cbe788 01cedb38 0579fd54 005e502c 00000000 0579fccc 00000000 00000001
     0579fca8: 051c0000 00037200 00000000 00000001 005cba78 051c0000 00001043 01cece98
     0579fcc8: 00037200 0579fd74 004c9abc 08a40080 051c0000 004c9c8a 0601c0e8 0601c28c
     0579fce8: 00000000 01cefcf8 01cefce0 01cbe788 01cefd00 01cefce0 0579fd54 0579fd48

Thread call stack:
0056aac4: VDVideoCompressorVCM::CompressFrame()
004c9abc: VideoSourceAVI::streamGetFrame()
004c9c8a: _catch$?streamGetFrame@VideoSourceAVI@@UAEPBXPBXI_N_J2@Z$0()
00466c77: VDThreadedVideoCompressor::ProcessFrame()
004671e1: VDThreadedVideoCompressor::ExchangeBuffer()
004685fc: VDDubProcessThread::WriteVideoFrame()
004688ff: VDDubProcessThread::WriteVideoFrame()
746040fc: WINMM!timeGetTime [74600000+40d0+2c]
00468d28: VDDubProcessThread::ThreadRun()
765242eb: kernel32!RaiseException [764e0000+44293+58]
77978464: ntdll!NtDuplicateObject [77920000+58458+c]
7652435c: kernel32!DuplicateHandle [764e0000+442f4+68]
76524379: kernel32!DuplicateHandle [764e0000+442f4+85]
76524379: kernel32!DuplicateHandle [764e0000+442f4+85]
0045c8f0: VDThreadInitHandler()
004f941d: VDThread::StaticThreadStart()
00586c18: _callthreadstartex()
00586cbd: _threadstartex@4()
76524911: kernel32!BaseThreadInitThunk [764e0000+448ff+12]
7795e4b6: ntdll!RtlInitializeExceptionChain [77920000+3e453+63]
7795e489: ntdll!RtlInitializeExceptionChain [77920000+3e453+36]

-- End of report


--------------------
useful links:
VirtualDub, Input plugins and filters, AviSynth, AVI-Mux GUI, AC3ACM by fcchandler, VirtualDub FAQ
 
    Top
phaeron
Posted: Jun 4 2008, 08:26 AM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Hmm... ended up having to tweak the table bounds a bit:

http://www.virtualdub.org/beta/VirtualDub-....8.X2-test3.zip
http://www.virtualdub.org/beta/VirtualDub-...test3-AMD64.zip
http://www.virtualdub.org/beta/VirtualDub-...X2-test3-src.7z

The sandbox that I built that from was a bit old, so it's possible you were hitting a bug that was already fixed on devline... so I've integrated in the current 1.8.1-rc2 source and so this build should be up to date. Try to crash it again.

I'm still trying to figure out why tinyupload.com exists. There aren't ads on it and you don't pay for it, so I can only guess that one of the following applies: someone's bored and naively altruistic, someone's slyly looking to beta test software before putting it into production, or someone's lazy and is trying to get other people to upload porn and warez to his server.
 
    Top
stephanV
Posted: Jun 4 2008, 09:33 AM


Spam killer ;)


Group: Moderators
Posts: 4348
Member No.: 8917
Joined: 18-February 04



File decodes properly, crash is gone. biggrin.gif

A little question about the UI that I noticed this morning while creating the test file. When No audio is selected, shouldn't most of the options in the audio menu be grayed out? It's no big deal, but the way it is now looks a bit weird in my eyes.

--------------------
useful links:
VirtualDub, Input plugins and filters, AviSynth, AVI-Mux GUI, AC3ACM by fcchandler, VirtualDub FAQ
 
    Top
phaeron
Posted: Jun 5 2008, 05:23 AM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Yeah, probably so, but disabling the items tends to be surprisingly confusing to users... another thing to work out in that nebulous date in the future when I have a lot of time and it gets magically easier for me to make UI that doesn't suck. I need to rework the UI, but never got a grip on a good general approach. Shoving the whole thing into one big dialog didn't seem much better.


 
    Top
sonical
Posted: Jun 6 2008, 02:13 PM


Advanced Member


Group: Members
Posts: 143
Member No.: 23118
Joined: 23-February 08




Well I think that VDub UI is quite good, and shouldn't realy be "enhanced" by graying out 101 items. Also, it's good if all options and settings are available even if there is no audio in current file: maybe next one will have it. It actually bothers me, if some kind of soft doesn't allow me to change properties of some settings until I enable them etc.

The only serious improvements for VDub UI I can think of are:

* additional flag in position display, which shows if frame is in the selected range or not
* additional exact position displays with selection start and end, so there no need to open the video selection range menu unless to change them manually. Plus a total selected time display, which is handy when figuring out reqiured bitrate to fit the selected crop in specific MBytes.
* edit menu option to CROP selection, not only cut/delete selection
* one additional (same as old) joblist, for WAV extraction without any hassle. So there is target WAVs list instead of output AVIs list.
* handy button to open up filters list, and another handy button to open up configuration of most recently configured filter.
* filter preview should have same options of display as preview panes.
* when opening up filter preview, current frame could be the same as for main preview windows, rather than frame 0.
* audio output device selection
* full screen input or output preview option (hotkey)

Well it's a heap of improvements for at least next three versions smile.gif

Regarding Huffyuv - seems to work well now!
 
     Top
Romashulka
Posted: Jun 8 2008, 12:28 PM


Newbie


Group: Members
Posts: 1
Member No.: 23693
Joined: 8-June 08



I think that all these transformations have second character.
The first that needs to be made is a support mkv
30-40 % of users will leave from megui, avidemux (and other programs) to virtualDub
VirtualDubmod has been stopped in 2005, but has mkv.
Now 2008 year dry.gif
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
8 replies since Jun 3 2008, 07:17 AM Track this topic | Email this topic | Print this topic

<< Back to Testing / Bug Reports