예제 #1
0
bool write_bmpfile24bit(string f_name, unsigned char *bitmap, int height,
		int width)
{
	fout.open(f_name.c_str(),ios::out | ios::binary);

	if (!fout.is_open()) return 0;

	h=height;

	original_w=width;

	if ( (width*3) % 12!=0){
		padbyte_count=(width*3/12+1)*12-width*3; //adding several zeroes, so the row size will be multiple of 3 and 4
		w=(width*3+padbyte_count)/3;
	}
	else {
		padbyte_count=0;
		w=width;
	}

	sz=h*w*3;

	if (!write_fileheader(0)) return 0;

	if (!write_dibheader(24)) return 0;

	if (!write_bitmap24(bitmap)) return 0;

	fout.close();
	return 1;
}
예제 #2
0
int main(void)
{
    cbrt_tableinit();

    write_fileheader();

    WRITE_ARRAY("static const", uint32_t, cbrt_tab);

    return 0;
}
예제 #3
0
int main(void)
{
    cabac_tableinit();

    write_fileheader();

    WRITE_ARRAY("const", uint8_t, ff_h264_cabac_tables);

    return 0;
}
int main(void)
{
	ff_aac_tableinit();

	write_fileheader();

	WRITE_ARRAY("const", float, ff_aac_pow2sf_tab);

	return 0;
}
예제 #5
0
파일: pcm_tablegen.c 프로젝트: 0Soul/FFmpeg
int main(void)
{
    pcm_alaw_tableinit();
    pcm_ulaw_tableinit();

    write_fileheader();

    WRITE_ARRAY("static const", uint8_t, linear_to_alaw);
    WRITE_ARRAY("static const", uint8_t, linear_to_ulaw);

    return 0;
}
예제 #6
0
파일: dv_tablegen.c 프로젝트: AVbin/libav
int main(void)
{
    dv_vlc_map_tableinit();

    write_fileheader();

    printf("static const struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE] = {\n");
    write_dv_vlc_pair_2d_array(dv_vlc_map, DV_VLC_MAP_RUN_SIZE, DV_VLC_MAP_LEV_SIZE);
    printf("};\n");

    return 0;
}
예제 #7
0
int main(void)
{
    cbrt_tableinit();

    write_fileheader();

    printf("static const uint32_t cbrt_tab[1<<13] = {\n");
    write_uint32_array(cbrt_tab, 1 << 13);
    printf("};\n");

    return 0;
}
int main(void)
{
	mpegaudio_tableinit();

	write_fileheader();

	WRITE_ARRAY("static const", int8_t, table_4_3_exp);
	WRITE_ARRAY("static const", uint32_t, table_4_3_value);
	WRITE_ARRAY("static const", uint32_t, exp_table);
	WRITE_ARRAY("static const", float, exp_table_float);
	WRITE_2D_ARRAY("static const", uint32_t, expval_table);
	WRITE_2D_ARRAY("static const", float, expval_table_float);

	return 0;
}
예제 #9
0
int main(void)
{
    int i;

    write_fileheader();

    for (i = 5; i <= 12; i++) {
        ff_init_ff_sine_windows(i);
        printf("SINETABLE(%4i) = {\n", 1 << i);
        write_float_array(ff_sine_windows[i], 1 << i);
        printf("};\n");
    }

    return 0;
}
int main(void)
{
    softclip_table_init();
    rnd_table_init();
    init_noise_samples();

    write_fileheader();

    WRITE_ARRAY("static const", uint16_t, softclip_table);
    WRITE_ARRAY("static const", float, noise_table);
    WRITE_ARRAY("static const", float, noise_samples);

    WRITE_2D_ARRAY("static const", uint8_t, random_dequant_index);
    WRITE_2D_ARRAY("static const", uint8_t, random_dequant_type24);

    return 0;
}
int main(void)
{
    ps_tableinit();

    write_fileheader();

    printf("static const float pd_re_smooth[8*8*8] = {\n");
    write_float_array(pd_re_smooth, 8*8*8);
    printf("};\n");
    printf("static const float pd_im_smooth[8*8*8] = {\n");
    write_float_array(pd_im_smooth, 8*8*8);
    printf("};\n");

    printf("static const float HA[46][8][4] = {\n");
    write_float_3d_array(HA, 46, 8, 4);
    printf("};\n");
    printf("static const float HB[46][8][4] = {\n");
    write_float_3d_array(HB, 46, 8, 4);
    printf("};\n");

    printf("static const float f20_0_8[8][7][2] = {\n");
    write_float_3d_array(f20_0_8, 8, 7, 2);
    printf("};\n");
    printf("static const float f34_0_12[12][7][2] = {\n");
    write_float_3d_array(f34_0_12, 12, 7, 2);
    printf("};\n");
    printf("static const float f34_1_8[8][7][2] = {\n");
    write_float_3d_array(f34_1_8, 8, 7, 2);
    printf("};\n");
    printf("static const float f34_2_4[4][7][2] = {\n");
    write_float_3d_array(f34_2_4, 4, 7, 2);
    printf("};\n");

    printf("static const float Q_fract_allpass[2][50][3][2] = {\n");
    write_float_4d_array(Q_fract_allpass, 2, 50, 3, 2);
    printf("};\n");
    printf("static const float phi_fract[2][50][2] = {\n");
    write_float_3d_array(phi_fract, 2, 50, 2);
    printf("};\n");

    return 0;
}
예제 #12
0
bool write_bmpfile(string f_name,char *bitmap,int height,int width)
{
	fout.open(f_name.c_str(),ios::out | ios::binary);

	if (!fout.is_open()) return 0;

	h=height;
	w=width;
	sz=h*w/8;
	cout<<sz<<'\n';
	cout<<h<<'\n';
	cout<<w<<'\n';
	if (!write_fileheader(6)) return 0;
	cout<<"ok\n";
	if (!write_dibheader(1)) return 0;
	cout<<"ok\n";
	if (!write_coltable()) return 0;
	cout<<"ok\n";
	if (!write_bitmap(bitmap)) return 0;
	cout<<"ok\n";
	fout.close();
	return 1;
}