Changed frame 8bit to 10bit conversion to be done without memory allocation

This commit is contained in:
Marko Viitanen 2015-04-30 15:42:22 +03:00
parent 6453a511d7
commit 58f12bd530

View file

@ -907,13 +907,11 @@ int encoder_feed_frame(encoder_state_t *const state, kvz_picture *const img_in)
} }
int frame_8bit_to_10bit(pixel_t* input, int width, int height) { int frame_8bit_to_10bit(pixel_t* input, int width, int height) {
uint8_t* temp_buffer = malloc(width*height); uint8_t* temp_buffer = (uint8_t*)input;
const uint32_t pixels = width*height; const uint32_t pixels = width*height;
memcpy(temp_buffer, (void *)input, pixels); for(int i = pixels-1; i >= 0; i--) {
for(int i = 0; i < pixels; i++) {
input[i] = temp_buffer[i]<<2; input[i] = temp_buffer[i]<<2;
} }
free(temp_buffer);
return 1; return 1;
} }