Some fix to VFR... maybe...

Originally committed to SVN as r299.
This commit is contained in:
Rodrigo Braz Monteiro 2006-04-04 13:22:45 +00:00
parent 72299b508c
commit a42321a7d9
3 changed files with 9 additions and 4 deletions

View file

@ -457,8 +457,12 @@ std::vector<int> PRSSubtitleFormat::GetFrameRanges() {
/////////////////////////////////////////////
// Optimize the image by tweaking the colors
// First, a little macro to help the comparisons down there
#define IN_ERROR_MARGIN(col1,col2,error) ((col1 > col2 ? ((int)(col1-col2)) : ((int)(col2-col1))) <= (error))
// Now, since I don't expect anyone to be able to decypher this...
// This "flood fills" the image based on alpha, to make it easier to compress, without affecting visual quality
// e.g. if you have a pixel with 25% opacity, then a difference of as much as 3 in the color channels won't have a visual impact
void PRSSubtitleFormat::OptimizeImage(wxImage &image) {
// Get the raw data
unsigned char *data = (unsigned char*) image.GetData();

View file

@ -279,8 +279,9 @@ int FrameRate::PFrameAtTime(int ms,bool useceil) {
else if (FrameRateType == VFR) {
// Get last
double trueLast;
if (useceil) trueLast = ceil(last_time);
else trueLast = floor(last_time);
//if (useceil) trueLast = ceil(last_time);
//else trueLast = floor(last_time);
trueLast = Frame[Frame.size()-1];
// Inside VFR range
if (ms < trueLast) {

View file

@ -150,8 +150,8 @@ void VideoDisplay::SetVideo(const wxString &filename) {
// Unload video
delete provider;
provider = NULL;
if (VFR_Output.GetFrameRateType() == VFR) VFR_Output.Unload();
VFR_Input.Unload();
//if (VFR_Output.GetFrameRateType() == VFR) VFR_Output.Unload();
//VFR_Input.Unload();
videoName = _T("");
loaded = false;
frame_n = 0;