This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
template<typename T> | |
struct is_validator | |
{ | |
static const bool value = false; | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef TJSON_H | |
#define TJSON_H | |
#include <string> | |
#include <vector> | |
#include <iostream> | |
#ifdef MINJSON | |
#define NL | |
#else | |
#define NL "\r\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
struct ResultT | |
{ | |
//dummy data | |
std::string someData; | |
ResultT() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <map> | |
template <typename T> | |
struct cmp | |
{ | |
bool operator()(std::pair<T, int>& a, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
a simple example of std::accumulate implemented in C | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#define ARRSIZE(X) (sizeof(X) / sizeof(X[0])) |
NewerOlder