}
if (memcmp (buffer_A.RoData(), buffer_B.RoData(), buffer_A.Size()) != 0) {
- notes.push_back ("PCM data for MXF frame " + lexical_cast<string>(i) + " differ");
-
for (uint32_t i = 0; i < buffer_A.Size(); ++i) {
int const d = abs (buffer_A.RoData()[i] - buffer_B.RoData()[i]);
- if (d) {
- notes.push_back ("First difference is " + lexical_cast<string> (d));
+ if (d > opt.max_audio_sample_error) {
+ notes.push_back ("PCM data difference of " + lexical_cast<string> (d));
return false;
}
}
- return false;
}
}
extern bool operator!= (Fraction const & a, Fraction const & b);
struct EqualityOptions {
+ EqualityOptions ()
+ : max_mean_pixel_error (0)
+ , max_std_dev_pixel_error (0)
+ , max_audio_sample_error (0)
+ {}
+
double max_mean_pixel_error;
double max_std_dev_pixel_error;
+ int max_audio_sample_error;
};
class Color
options.max_mean_pixel_error = 5;
options.max_std_dev_pixel_error = 5;
+ /* I think this is just below the LSB at 16-bits (ie the 8th most significant bit at 24-bit) */
+ options.max_audio_sample_error = 255;
list<string> notes;
bool equals = a->equals (*b, options, notes);