Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th March 2006, 22:32   #21  |  Link
hellfred
FFmpeg fan
 
Join Date: Dec 2003
Location: Germany
Posts: 427
Quote:
Originally Posted by akupenguin
That's unsigned integers or shift operators... because x/2 is not the same as x>>1 for signed x, so no compiler is allowed to optimize one into the other.
I am not sure if I understood you correct.
I wanted to express that ppl are advised to change
Code:
int x = 8;
int y = x/2;
to
Code:
unsigned int x = 8;
unsigned y = x >> 1;
So they are supposed to use unsigned int together with the shift operator.
here.
Hellfred

Small programm to test:
Code:
#include <iostream>
using namespace std;
int main() {
	unsigned int x = 8;
	x = x >> 1;                // x/2
	cout << x << endl;
	x = x >> 1;                // x/2
	cout << x << endl;
	unsigned int y = 2;
	y = y << 1;                // y*2
	cout << y << endl;
	y = y << 1;                // y*2
	cout << y << endl;
	return 0;
}
will output
Code:
haibane@LapLap:~/tmp$ g++ shift.cpp -o shift
haibane@LapLap:~/tmp$ ./shift
4
2
4
8

Last edited by hellfred; 20th March 2006 at 22:42.
hellfred is offline   Reply With Quote
Old 21st March 2006, 00:57   #22  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,392
Quote:
Originally Posted by hellfred
I am not sure if I understood you correct.
I wanted to express that ppl are advised to change
Code:
int x = 8;
int y = x/2;
to
Code:
unsigned int x = 8;
unsigned y = x >> 1;
So they are supposed to use unsigned int together with the shift operator.
That was not quite the advice. First, since x is a constant, the math will be optimized away either way. So consider:
Code:
int munge0(int x) { return x/2; }
If x is really always nonnegative, that should be changed to any one of
Code:
int munge1(int x) { return x>>1; }
int munge2(unsigned int x) { return x/2; }
int munge3(unsigned int x) { return x>>1; }
...which are all equivalent, and faster than the 1st version.
munge1 though munge3 will be compiled into a single shift instruction. munge0 can't, because (-1)>>1 != (-1)/2

Last edited by akupenguin; 21st March 2006 at 01:08.
akupenguin is offline   Reply With Quote
Old 21st March 2006, 01:39   #23  |  Link
IgorC
Registered User
 
Join Date: Apr 2004
Posts: 1,315
I'm not a video dev so don't push on me hard but maybe if they used signed int it will be also possible to verifire if integer is negative (complement to 2) by masking it with something like 0x80 and do optimisation only if integer >0

Nice decoder but still no information about it from on2 (they are too busy with a new generation of vp8/vp9 )

Last edited by IgorC; 21st March 2006 at 01:58.
IgorC is offline   Reply With Quote
Old 21st March 2006, 10:53   #24  |  Link
hellfred
FFmpeg fan
 
Join Date: Dec 2003
Location: Germany
Posts: 427
OT: c programming tips

Thanks for enligthning me, akupenguing.
Can you suggest a source that will teach me lots of c/c++ tweaks like the use of the shift operator for division with 2^n on unsigneded integers. I had c / c++ lessons only for about 1 year at university, and they mainly covered the basic. So I do need to learn those tricks to be ever able to understand the sourcecode of projects like x264/mplayer/ffmpeg. And understanding is required before I am able to help with such projects.

Hellfred
hellfred is offline   Reply With Quote
Old 21st March 2006, 13:49   #25  |  Link
bratao
Registered User
 
Join Date: May 2005
Posts: 146
I think that its Official code, not Reversed code..
The code is So clear , commented and dosnt have Magics numbers
bratao is offline   Reply With Quote
Old 21st March 2006, 14:01   #26  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by bratao
I think that its Official code, not Reversed code..
The code is So clear , commented and dosnt have Magics numbers
Or stolen...
dimzon is offline   Reply With Quote
Old 21st March 2006, 14:29   #27  |  Link
gabest
Registered User
 
gabest's Avatar
 
Join Date: Oct 2001
Posts: 1,459
Quote:
Originally Posted by akupenguin
munge1 though munge3 will be compiled into a single shift instruction. munge0 can't, because (-1)>>1 != (-1)/2
Not a single shift, but it can be done with two additional instructions: (eax = -1)
(-1)>>1: sar eax, 1
(-1)/2: cdq / sub eax, edx / sar eax, 1
__________________
gabest.org
gabest is offline   Reply With Quote
Old 22nd March 2006, 13:20   #28  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
@dizmon

you should update your post "On2 VP7 is great in quality but it is unusable for long-term video backup puposes!" since now VP62 is opensource
__________________
Detritus Software
Sirber is offline   Reply With Quote
Old 22nd March 2006, 13:24   #29  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by Sirber
@dizmon

you should update your post "On2 VP7 is great in quality but it is unusable for long-term video backup puposes!" since now VP62 is opensource
Done
dimzon is offline   Reply With Quote
Old 22nd March 2006, 13:27   #30  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
anyone heard of a CLI VP6 encoder that input AVS?
__________________
Detritus Software
Sirber is offline   Reply With Quote
Old 22nd March 2006, 13:42   #31  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by Sirber
anyone heard of a CLI VP6 encoder that input AVS?
Just wait a little - it will be assimilated by ffmpeg
dimzon is offline   Reply With Quote
Old 22nd March 2006, 13:43   #32  |  Link
Adz
Registered User
 
Join Date: Nov 2003
Posts: 44
so let me get this right, there will soon be an ffmpeg build with the ability to produce VP6 based FLV files?

I currently use ffmpeg alot to produce FLV files, not sure what the video codec name is but it's pretty bad in comparison to equivelent sized WMV's i've produced. This would be great.
Adz is offline   Reply With Quote
Old 22nd March 2006, 13:45   #33  |  Link
hellfred
FFmpeg fan
 
Join Date: Dec 2003
Location: Germany
Posts: 427
Just decoder up to now

Quote:
Originally Posted by Sirber
anyone heard of a CLI VP6 encoder that input AVS?
Sirber, you are ahead of time. Though the project aims to implement both the decoder and encoder for VP6, there is only the decoder at the moment. So you have to go ask On2 for any encoder app.

Hellfred
hellfred is offline   Reply With Quote
Old 22nd March 2006, 13:46   #34  |  Link
Adz
Registered User
 
Join Date: Nov 2003
Posts: 44
sorry to go OFT, but are there any better codecs that can be used in FLV (and decodable by standard flash player) that are better than the one built into ffmpeg (sorry dont know name of the actual codec used ffmpeg).
Adz is offline   Reply With Quote
Old 22nd March 2006, 14:27   #35  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
@hellfred

Thanks for the info!
__________________
Detritus Software
Sirber is offline   Reply With Quote
Old 22nd March 2006, 16:25   #36  |  Link
celtic_druid
Registered User
 
celtic_druid's Avatar
 
Join Date: Oct 2001
Location: Melbourne, Australia
Posts: 2,171
Looks like the project has been removed.
celtic_druid is offline   Reply With Quote
Old 22nd March 2006, 16:31   #37  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
CVS still online. Get it while it's avalible
__________________
Detritus Software
Sirber is offline   Reply With Quote
Old 22nd March 2006, 16:44   #38  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
Here's a link to the files:

libvp62.tar.bz2
__________________
Detritus Software
Sirber is offline   Reply With Quote
Old 22nd March 2006, 22:29   #39  |  Link
hellfred
FFmpeg fan
 
Join Date: Dec 2003
Location: Germany
Posts: 427
Quote:
Originally Posted by Sirber
Here's a link to the files:

libvp62.tar.bz2
This file was reported as illegal material.
Access to the file is temporary blocked.

Gone, too.

Hellfred
hellfred is offline   Reply With Quote
Old 22nd March 2006, 22:33   #40  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
Want another link?

Files are still on CVS in any case: http://cvs.sourceforge.net/viewcvs.py/libvp62/

[edit]

new link
__________________
Detritus Software

Last edited by Sirber; 22nd March 2006 at 22:41.
Sirber is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.