Skip to content

Instantly share code, notes, and snippets.

View heatblazer's full-sized avatar
😉
working... probably

ilian zapryanov heatblazer

😉
working... probably
  • this->company
  • there
View GitHub Profile
@heatblazer
heatblazer / zigzag.cpp
Last active June 8, 2023 09:44
zigzaging of NxN matrix
#include <iostream>
/**
*
*Entropy coding is a special form of lossless data compression.
*It involves arranging the image components in a "zigzag" order employing run-length encoding (RLE) algorithm that groups similar frequencies together, inserting length coding zeros, and then using Huffman coding on what is left.
The JPEG standard also allows, but does not require, decoders to support the use of arithmetic coding, which is mathematically superior to Huffman coding.
However, this feature has rarely been used, as it was historically covered by patents requiring royalty-bearing licenses, and because it is slower to encode and decode compared to Huffman coding.
Arithmetic coding typically makes files about 5–7% smaller.
The previous quantized DC coefficient is used to predict the current quantized DC coefficient. The difference between the two is encoded rather than the actual value. The encoding of the 63 quantized AC coefficients does not use such prediction differencing.
as given
// fmake.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE 1
#endif // !_CRT_SECURE_NO_DEPRECATE - fopen and friends
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <cstring>
template<typename T>
struct is_validator
{
static const bool value = false;
};
// SAT.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
int main()
{
static const int W = 5;
static const int H = 5;
int counter = 1;
#include <iostream>
#include <vector>
#include <array>
// this template would tell us the T is not an array like type
// ex. - does not have [n] operator overloaded
// for simplicity - or it's a poorman specialization below
template <typename T>
struct is_arraytype
{
#ifndef TJSON_H
#define TJSON_H
#include <string>
#include <vector>
#include <iostream>
#ifdef MINJSON
#define NL
#else
#define NL "\r\n"
#include <iostream>
#include <string>
#include <vector>
struct ResultT
{
//dummy data
std::string someData;
ResultT()
{
#include <sys/mman.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
/* from objdump - S
int foo(int a, int b)
{
401110: 55 push %rbp
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
template <typename T>
struct cmp
{
bool operator()(std::pair<T, int>& a,
/**
a simple example of std::accumulate implemented in C
*/
#include <stdio.h>
#include <string.h>
#define ARRSIZE(X) (sizeof(X) / sizeof(X[0]))