Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compression > #1412

Re: video compression idea

From BGB <cr88192@hotmail.com>
Newsgroups comp.compression
Subject Re: video compression idea
Date 2012-07-10 22:54 -0500
Organization albasani.net
Message-ID <jtithl$bsb$1@news.albasani.net> (permalink)
References (2 earlier) <4ff03aa1$0$292$14726298@news.sunsite.dk> <5fd61f2a-97ec-475c-9495-9915321b2eb3@t1g2000pbl.googlegroups.com> <jstbgl$oia$1@news.albasani.net> <0179829e-13c6-4afd-9224-86ac6c71dfb4@n16g2000vbn.googlegroups.com> <jti8r0$ijh$1@news.albasani.net>

Show all headers | View raw


On 7/10/2012 5:00 PM, BGB wrote:
> On 7/10/2012 2:01 PM, Jim Leonard wrote:
>> On Jul 2, 6:38 pm, BGB <cr88...@hotmail.com> wrote:
>>> since then, I have been using MJPEG, but the performance isn't as good.
>>
>> What's your target platform?
>>
>
> Windows+Linux (x86 and x86-64) and OpenGL.
>
> I did optimize it a bit more, but it could still be better.
>

...

nevermind me realizing it was Mpx, not Mpix.


>
> a few optimizations I found:
> the 4:2:0 case is detected, and pixels are transformed 4 at a time
> (2x2), for the YCbCr->RGB conversion;
> made the observation that by doing things like
> "if((r0|r1|r2|r3)&(~256))", I could skip out on a lot of range-clamping
> checks;
> ...
>

correction: ~255.
the basic idea is that, if all are in the 0-255 range, (...)&(~255) will 
give 0.

if the value is non-zero, then at least one of the values is out of 
range, and the logic can be invoked to clamp the values.


the reason for sitting around micro-optimizing the color-space 
conversion and output-range clamping was because most of time in the 
profiler was going into this.

note that the reason for using 2x2 pixel-blocks was to allow reducing 
the amount of time needed to fetch the YCbCr values from the macroblocks.


> currently, the YCbCr -> RGB conversion phase is still the main
> time-waster, followed by the logic for reading in DCT blocks, followed
> by the logic for decoding Huffman symbols, followed by the IDCT
> transform, the function for DCT block * QTab, ...
>
> nearly all math at present is fixed-point (scalar integer math, no SIMD).
>

basically, a secondary goal would be to get comparable or better decoder 
performance to a proper video codec, just while being single-threaded 
and compiled with debug+profile settings, and no SIMD, ...

this is looking unlikely though, at least using normal JPEG (and without 
cutting corners in nasty ways).

I wonder though how some of this compares with "typical" JPEG decoders, 
as I haven't really done any comparative benchmarks.



ironically, the IDCT doesn't eat a lot of time (vs other "simpler" 
linear processes).

nevermind that I originally wrote the IDCT code (some years ago), but no 
longer remember exactly how exactly it works (it resembles some sort of 
math triangle thing). I think I vaguely remember it involving observing 
number patterns and factoring stuff in an effort to reduce the 
complexity (memory also seems to say that I could have factored it 
further, but would require first expanding out the full 2D transform and 
then factoring it, basically to make an IDCT shaped like a pyramid, or 
something).


crap, maybe sometimes I am becoming steadily stupider, as what is left 
of my youth slips away.


or such...

Back to comp.compression | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

video compression idea Alex Mizrahi <alex.mizrahi@gmail.com> - 2012-06-29 13:35 +0300
  Re: video compression idea BGB <cr88192@hotmail.com> - 2012-06-29 12:04 -0500
    Re: video compression idea Alex Mizrahi <alex.mizrahi@gmail.com> - 2012-07-01 14:55 +0300
      Re: video compression idea BGB <cr88192@hotmail.com> - 2012-07-01 12:22 -0500
      Re: video compression idea Jim Leonard <mobygamer@gmail.com> - 2012-07-02 12:04 -0700
        Re: video compression idea BGB <cr88192@hotmail.com> - 2012-07-02 18:38 -0500
          Re: video compression idea Jim Leonard <mobygamer@gmail.com> - 2012-07-10 12:01 -0700
            Re: video compression idea BGB <cr88192@hotmail.com> - 2012-07-10 17:00 -0500
              Re: video compression idea BGB <cr88192@hotmail.com> - 2012-07-10 22:54 -0500
    Re: video compression idea Industrial One <industrial_one@hotmail.com> - 2012-07-02 04:32 -0700
      Re: video compression idea BGB <cr88192@hotmail.com> - 2012-07-02 10:38 -0500
      Re: video compression idea Alex Mizrahi <alex.mizrahi@gmail.com> - 2012-07-04 10:23 +0300
        Re: video compression idea BGB <cr88192@hotmail.com> - 2012-07-04 11:56 -0500
          Re: video compression idea "George Johnson" <matrix29@charter.net> - 2012-07-04 22:52 -0400
            Re: video compression idea Industrial One <industrial_one@hotmail.com> - 2012-07-11 09:03 -0700
  Re: video compression idea SG <s.gesemann@gmail.com> - 2012-07-02 01:44 -0700
  Re: video compression idea Noob <root@127.0.0.1> - 2012-07-02 12:52 +0200

csiph-web