Improved compression function: Instead of using a fixed threshold, we will now update the threshold for each frame. The threshold for a particular frame is defined as "MEAN + (C1 * STANDARD_DEVIATION)", where C1 is a user-defined parameter.