<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <string.h>

#define STB_IMAGE_IMPLEMENTATION
#include "../externals/stb/stb_image.h"
#define STB_TRUETYPE_IMPLEMENTATION
#include "../externals/stb/stb_truetype.h"

#include "easypng.h"

// Stitch FFT sweeps PNG

const uint32_t FFT_SIZE = 4096;
const uint32_t FFT_HISTORY_SIZE = 4096;
const uint64_t FREQUENCY_START = 10e6;
const uint64_t FREQUENCY_END = 310e6;
const uint32_t FREQUENCY_STEP = 5e6;
const uint32_t SAMPLE_RATE = 5e6;

const uint32_t FREQUENCY_RANGE = (FREQUENCY_END - FREQUENCY_START) / FREQUENCY_STEP;
const uint32_t WIDTH_STEP = FFT_SIZE / (SAMPLE_RATE / FREQUENCY_STEP);
const uint32_t IMAGE_WIDTH = FFT_SIZE + (FREQUENCY_RANGE) * WIDTH_STEP;
const uint32_t IMAGE_HEIGHT = FFT_HISTORY_SIZE;


// Utility //////////////////////////////////////////////////////////////////

uint8_t max_u8(uint8_t a, uint8_t b) {
    return a > b ? a : b;
}

// Image operations /////////////////////////////////////////////////////////

void img_gray_copy(uint8_t *dst, uint8_t *src, uint32_t dst_x, uint32_t dst_y, uint32_t src_x, uint32_t src_y, uint32_t width, uint32_t height, uint32_t dst_stride, uint32_t src_stride) {
    for (uint32_t i = 0; i < height; i++) {
        for (uint32_t j = 0; j < width; j++) {
            uint32_t dst_offset = (dst_y + i) * dst_stride + dst_x + j;
            uint32_t src_offset = (src_y + i) * src_stride + src_x + j;
            dst[dst_offset] = max_u8(dst[dst_offset], src[src_offset]);<commit_msg>Adapt to much smaller FFT SIZE.<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <string.h>

#define STB_IMAGE_IMPLEMENTATION
#include "../externals/stb/stb_image.h"
#define STB_TRUETYPE_IMPLEMENTATION
#include "../externals/stb/stb_truetype.h"

#include "easypng.h"

// Stitch FFT sweeps PNG

const uint32_t FFT_SIZE = 256;
const uint32_t FFT_HISTORY_SIZE = 4096;
const uint64_t FREQUENCY_START = 10e6;
const uint64_t FREQUENCY_END = 60e6;
const uint32_t FREQUENCY_STEP = 5e6;
const uint32_t SAMPLE_RATE = 5e6;

const uint32_t FREQUENCY_RANGE = (FREQUENCY_END - FREQUENCY_START) / FREQUENCY_STEP;
const uint32_t WIDTH_STEP = FFT_SIZE / (SAMPLE_RATE / FREQUENCY_STEP);
const uint32_t IMAGE_WIDTH = FFT_SIZE + (FREQUENCY_RANGE) * WIDTH_STEP;
const uint32_t IMAGE_HEIGHT = FFT_HISTORY_SIZE;


// Utility //////////////////////////////////////////////////////////////////

uint8_t max_u8(uint8_t a, uint8_t b) {
    return a > b ? a : b;
}

// Image operations /////////////////////////////////////////////////////////

void img_gray_copy(uint8_t *dst, uint8_t *src, uint32_t dst_x, uint32_t dst_y, uint32_t src_x, uint32_t src_y, uint32_t width, uint32_t height, uint32_t dst_stride, uint32_t src_stride) {
    for (uint32_t i = 0; i < height; i++) {
        for (uint32_t j = 0; j < width; j++) {
            uint32_t dst_offset = (dst_y + i) * dst_stride + dst_x + j;
            uint32_t src_offset = (src_y + i) * src_stride + src_x + j;
            dst[dst_offset] = max_u8(dst[dst_offset], src[src_offset]);
{'fraction_non_alphanumeric': 0.1780424983902125, 'fraction_numerical': 0.04571796522858983, 'mean_word_length': 2.9378960709759188, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5589798', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1242, 'n_words': 274}