/*
* CINELERRA
* Copyright (C) 1997-2011 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
-#include "clip.h"
+#include "bccolors.h"
#include "bchash.h"
+#include "clip.h"
#include "filexml.h"
#include "keyframe.h"
#include "language.h"
-#include "cicolors.h"
+#include "bccolors.h"
#include "timeavg.h"
#include "timeavgwindow.h"
#include "transportque.h"
TimeAvgMain::TimeAvgMain(PluginServer *server)
: PluginVClient(server)
{
-
+
accumulation = 0;
history = 0;
history_size = 0;
TimeAvgMain::~TimeAvgMain()
{
-
+
if(accumulation) delete [] accumulation;
if(history)
// Allocate accumulation
if(!accumulation || reset)
{
- if(!accumulation) accumulation = new unsigned char[w *
- h *
+ if(!accumulation) accumulation = new unsigned char[w *
+ h *
BC_CModels::components(color_model) *
MAX(sizeof(float), sizeof(int))];
reset_accum(w, h, color_model);
// Create new frames
for( ; i < config.frames; i++)
{
- history2[i] = new VFrame(w, h, color_model);
+ history2[i] = new VFrame(w, h, color_model, 0);
history_frame2[i] = -0x7fffffff;
history_valid2[i] = 0;
}
{
history = new VFrame*[config.frames];
for(int i = 0; i < config.frames; i++)
- history[i] = new VFrame(w, h, color_model);
+ history[i] = new VFrame(w, h, color_model, 0);
history_size = config.frames;
history_frame = new int64_t[config.frames];
bzero(history_frame, sizeof(int64_t) * config.frames);
for(int j = 0; j < history_size; j++)
{
// Old frame is equal to a new frame
- if(history_frame[i] == new_history_frames[j])
+ if(history_frame[i] == new_history_frames[j])
{
got_it = 1;
break;
reset_accum(w, h, color_model);
}
-// printf("TimeAvgMain::process_buffer %d prev_frame=%jd start_position=%jd\n",
+// printf("TimeAvgMain::process_buffer %d prev_frame=%jd start_position=%jd\n",
// __LINE__, prev_frame, start_position);
for(int64_t i = prev_frame; i <= start_position; i++)
{
frame_rate,
0);
add_accum(frame);
-printf("TimeAvgMain::process_buffer %d prev_frame=%jd start_position=%jd i=%jd\n",
+printf("TimeAvgMain::process_buffer %d prev_frame=%jd start_position=%jd i=%jd\n",
__LINE__, prev_frame, start_position, i);
}
}
}
-#define RGB_TO_VALUE(r, g, b) \
-((r) * R_TO_Y + (g) * G_TO_Y + (b) * B_TO_Y)
+#define RGB_TO_VALUE(r, g, b) YUV::yuv.rgb_to_y_f((r),(g),(b))
// Only AVERAGE and ACCUMULATE use this
#define SUBTRACT_ACCUM(type, \
void TimeAvgMain::update_gui()
{
- if(thread)
+ if(thread)
{
if(load_configuration())
{