Projects
home:Aloysius:branches:Multimedia
avidemux
avidemux-stdlib.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File avidemux-stdlib.patch of Package avidemux
--- a/avidemux/ADM_inputs/ADM_h263/ADM_h263.cpp +++ b/avidemux/ADM_inputs/ADM_h263/ADM_h263.cpp @@ -169,7 +169,7 @@ uint8_t h263Header::open(const char * delta &=0xff; if(!nbImg) delta=0; //++++++++++++++PTYPE++++++++++++ - if(((word&0xc0)==0x80) && ( abs(delta)<MAX_DELTA)) + if(((word&0xc0)==0x80) && ( delta < MAX_DELTA)) { last_pts=pts; nbImg++; --- a/avidemux/ADM_inputs/ADM_ogm/ADM_ogmAudio.cpp +++ b/avidemux/ADM_inputs/ADM_ogm/ADM_ogmAudio.cpp @@ -19,8 +19,9 @@ // #include "config.h" #include <stdio.h> -#include <stdlib.h> #include <string.h> +#include <cstdlib> +#include <cmath> #include "ADM_assert.h" #define MINUS_ONE 0xffffffff @@ -359,7 +360,7 @@ uint32_t fl; // // } // 1/16 sec is close enough -#define CLOSE_ENOUGH (44100>>16) +#define CLOSE_ENOUGH (44100ULL>>16ULL) // we will use the pcm equ to find where to jump uint8_t oggAudio::goToTime(uint32_t mstime) { @@ -402,7 +403,7 @@ static WAVHeader hdr; // Now we forward till the next header is > value while(_demuxer->readHeaderOfType(_currentTrack->audioTrack,&cursize,&flags,&f)) { - if(f>val || abs(f-val)<CLOSE_ENOUGH) + if(f > val || std::abs((long long)(f - val)) < (long long)CLOSE_ENOUGH) { aprintf("Wanted %llu",val); aprintf(" got %llu\n",f); --- a/avidemux/ADM_outputs/oplug_ogm/op_ogsave.cpp +++ b/avidemux/ADM_outputs/oplug_ogm/op_ogsave.cpp @@ -163,7 +163,7 @@ uint8_t error=0; } } - if(abs(j-_togo)<3 && error) error=0; // might be caused by late B frame + if((_togo - j) < 3 && error) error=0; // might be caused by late B frame delete encoding_gui; encoding_gui=NULL; //________________ Flush______________________ --- a/avidemux/ADM_userInterfaces/ADM_commonUI/DIA_bitrateHisto.cpp +++ b/avidemux/ADM_userInterfaces/ADM_commonUI/DIA_bitrateHisto.cpp @@ -50,7 +50,7 @@ uint32_t maxBFrame=0; // 1st compute the total max=0; - if(!(frameEnd>frameStart) || abs(frameStart-frameEnd)<5) + if(!(frameEnd>frameStart) || (frameStart-frameEnd)<5) { GUI_Error_HIG(QT_TR_NOOP("No data"), NULL); return ; --- a/avidemux/gtk_gui.cpp +++ b/avidemux/gtk_gui.cpp @@ -1814,7 +1814,7 @@ uint8_t ADM_saveRaw (const char *name) } if (!found) { - if(abs(i-frameEnd)>2) + if((frameEnd - i) > 2) ret=0; else ret=1; // Good enough --- a/avidemux/gui_navigate.cpp +++ b/avidemux/gui_navigate.cpp @@ -243,7 +243,8 @@ void GUI_NextPrevBlackFrame(int dir) else total=curframe+1; while(1) { - int current=abs(curframe-orgFrame); + uint32_t current; + current = curframe > orgFrame ? curframe - orgFrame : orgFrame - curframe; f=curframe+dir; if(work->update(current,total)) break; --- a/plugins/ADM_videoEncoder/ADM_vidEnc_mpeg2enc/mpeg2enc/find_best_one_pel.cc +++ b/plugins/ADM_videoEncoder/ADM_vidEnc_mpeg2enc/mpeg2enc/find_best_one_pel.cc @@ -1,7 +1,7 @@ #include "config.h" -#include <stdlib.h> -#include <limits.h> -#include <math.h> +#include <cstdlib> +#include <cmath> +#include <climits> #include "mmxsse_motion.h" #include "fastintfns.h" @@ -30,7 +30,7 @@ void find_best_one_pel_mmxe( me_result_s int x; matchrec = sub22set->mests[k]; orgblk = org + (i0+matchrec.x)+rowstride*(j0+matchrec.y); - penalty = (abs(matchrec.x) + abs(matchrec.y))<<3; + penalty = (std::abs((int)matchrec.x) + std::abs((int)matchrec.y))<<3; /* Get SAD for macroblocks: orgblk,orgblk(+1,0), orgblk(0,+1), and orgblk(+1,+1) --- a/plugins/ADM_videoFilters/Telecide/ADM_vidDecTelecide.cpp +++ b/plugins/ADM_videoFilters/Telecide/ADM_vidDecTelecide.cpp @@ -31,6 +31,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <cstdlib> +#include <cmath> #include "ADM_default.h" #include "ADM_plugin_translate.h" #include "ADM_videoFilterDynamic.h" @@ -690,7 +692,7 @@ uint8_t *finalpU,*finalpV; { // The chosen frame doesn't match the prediction. if (predicted_metric == 0) mismatch = 0.0; - else mismatch = (100.0*abs(predicted_metric - lowest))/predicted_metric; + else mismatch = (100.0*std::abs((int)(predicted_metric - lowest)))/predicted_metric; if (mismatch < gthresh) { // It's close enough, so use the predicted one. @@ -732,7 +734,7 @@ uint8_t *finalpU,*finalpV; { // The chosen frame doesn't match the prediction. if (predicted_metric == 0) mismatch = 0.0; - else mismatch = (100.0*abs(predicted_metric - lowest))/predicted_metric; + else mismatch = (100.0*std::abs((int)(predicted_metric - lowest)))/predicted_metric; if ((int) mismatch <= gthresh) { // It's close enough, so use the predicted one. @@ -1222,7 +1224,7 @@ void Telecide::CalculateMetrics(int fram // Test combination with current frame. tmp1 = ((long)currbot0[x] + (long)currbot2[x]); // diff = abs((long)currtop0[x] - (tmp1 >> 1)); - diff = abs((((long)currtop0[x] + (long)currtop2[x] + (long)currtop4[x])) - (tmp1 >> 1) - tmp1); + diff = std::abs((((long)currtop0[x] + (long)currtop2[x] + (long)currtop4[x])) - (tmp1 >> 1) - tmp1); if (diff > nt) { c += diff; @@ -1242,7 +1244,7 @@ void Telecide::CalculateMetrics(int fram // Test combination with previous frame. tmp1 = ((long)a0[x] + (long)a2[x]); - diff = abs((((long)b0[x] + (long)b2[x] + (long)b4[x])) - (tmp1 >> 1) - tmp1); + diff = std::abs((((long)b0[x] + (long)b2[x] + (long)b4[x])) - (tmp1 >> 1) - tmp1); if (diff > nt) { p += diff; @@ -1341,7 +1343,7 @@ void Telecide::CalculateMetrics(int fram // Test combination with current frame. tmp1 = ((long)currbot0[x] + (long)currbot2[x]); - diff = abs((((long)currtop0[x] + (long)currtop2[x] + (long)currtop4[x])) - (tmp1 >> 1) - tmp1); + diff = std::abs((((long)currtop0[x] + (long)currtop2[x] + (long)currtop4[x])) - (tmp1 >> 1) - tmp1); if (diff > nt) { c += diff; @@ -1361,7 +1363,7 @@ void Telecide::CalculateMetrics(int fram // Test combination with previous frame. tmp1 = ((long)a0[x] + (long)a2[x]); - diff = abs((((long)b0[x] + (long)b2[x] + (long)b4[x])) - (tmp1 >> 1) - tmp1); + diff = std::abs((((long)b0[x] + (long)b2[x] + (long)b4[x])) - (tmp1 >> 1) - tmp1); if (diff > nt) { p += diff; @@ -1586,7 +1588,7 @@ struct PREDICTION *Telecide::PredictSoft c = cache[y%CACHE_SIZE].metrics[C]; n = cache[y%CACHE_SIZE].metrics[N]; if (c == 0) c = 1; - metric = (100 * abs (c - n)) / c; + metric = (100 * std::abs (c - n)) / c; phase = y % cycle; if (metric < 5) {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.