Document number​: ​DXXXX Date​: 2016-10-07 Reply-to​: Guy Davidson, ​[email protected] Reply-to​: Paul Kitchin, ​[email protected] Audience​: Library Evolution (LEWG), Game dev and low latency (SG14)

A proposal to add a transcoding library to the standard library 0. Contents 1. 2. 3. 4. 5.

Introduction Impact on the standard Motivation Design Future work

1. Introduction This proposal introduces support for transcoding. Support for compression and encryption are conspicuously absent from the standard library, and these are both types of transcoding​. The author seeks feedback on the approach presented before committing to a thorough treatment.

2. Impact on the standard This proposal is a pure library extension. It does not require changes to any standard classes, functions or headers.

3. Motivation One of the fundamental aspects of software development is the transformation of data from one representation to another. This is even embodied in the standard library through the function std::transform, which performs a supplied unary or binary operation on each element of a range and sends the result to an output iterator. This is an isomorphic transformation. Compression, on the other hand, works in a different way. It does not isomorphically transform data, it in fact turns a range of data into a smaller range of data. Decompression turns a range of data into a larger range of data. Encryption can be isomorphic, but this is not a necessary feature of encryption: the encryptor may wish to perform compression along the way, or add redundant misdirector data. std::transform is therefore not sufficient for the job of this branch of transcoding.

4. Design There are many compression and encryption algorithms, some of which are in the public domain, many of which are patented, commercial property. It is not controversial to suggest that the standard should only include implementations of algorithms that are in the public domain. However, any implementation of a transcoding library should enable third party providers to support a simple interface.

It would be trivial to simply add support for specific algorithms by specifying functions with signatures such as template< class ExecutionPolicy, class InputIt, class OutputIt > OutputIt compress_lzw( ExecutionPolicy&& policy, InputIt first, InputIt last, OutputIt dest, struct lzw_parameter const& p ); Here, the example function compresses a range using the LZW algorithm, controlled by the parameters passed in p, and writes it to dest. However, this lacks flexibility. All that is required is a customisation of the output iterator to write the data after compressing it. Consider an output iterator adaptor based on Unix c ​ ompress ​: template> class lzw_compressor : public OutIt { public: lzw_compressor(OutIt&& dest_, int bits); lzw_operator& operator*() { return *this; } lzw_operator& operator=(const char&); // compress here private: Allocator allocator; int bits; }; The compression work is done in the assignment operator; it can be implemented in external library functions or in the class itself. In this example the implementation exists in the class itself, and is likely to require allocation to store consecutive writes before compressing and sending them to the parent output iterator. This can be used thus: using compressor = sg14::lzw_compressor>; std::copy(std::begin(buffer), std::end(buffer), compressor(std::ostream_iterator(file), 16)); Any transcoder can adapt an output iterator, not just a compressor. An encryptor based on RSA encryption might look like this: template class rsa_encryptor : public OutIt { public:

rsa_encryptor(OutIt&& dest_, int m_, int n_); rsa_encryptor& operator*() { return *this; } rsa_encryptor& operator=(const char&); // encrypt here private: int m; int n; }; This can be used thus: using encryptor = sg14::rsa_encryptor>; std::copy(std::begin(buffer), std::end(buffer), encryptor(std::ostream_iterator(file), 37, 91)); Transcoding adaptors can be composed. If the user wishes to compress and encrypt a buffer, the code would look like this: using encryptor = sg14::rsa_encryptor>; using compressor = sg14::lzw_compressor; auto file = std::copy(std::begin(buffer), std::end(buffer), compressor( encryptor(std::ostream_iterator(file), 37, 91), 16));

5. Future work If this approach is supported, future work will consist of collecting together a selection of encryption/decryption and compression/decompression transcoders that are in the public domain or that can be licensed appropriately for inclusion. A call will be put out to the development community for suggestions for such transcoders. This collection can then be implemented as output iterator adaptors and presented to the committee for approval prior to generating the correct wording.

A proposal to add a transcoding library to the ... -

One of the fundamental aspects of software development is the transformation of data from ... domain, many of which are patented, commercial property. It is not ...

106KB Sizes 3 Downloads 135 Views

Recommend Documents

A Proposal to add lambda traits to the STL -
Date: 2013-11-06. Project: Programming Language C++, Library Evolution Working Group ... This proposal aims to support compile-time retrieval of lambda ...

how to add a printer.pdf
will need to download the PaperCut client here. Page 1 of 1. how to add a printer.pdf. how to add a printer.pdf. Open. Extract. Open with. Sign In. Main menu.

From Research Hypotheses to Practical Guidelines: A Proposal to ...
leverages the power of social networking as a vehicle for collaboration between researchers and practitioners, which will mutually benefit both parties. Conduits ...

Add a contractor or employee to G Suite
First, check your G Suite subscription to see how users are added ... Click Billing . Next to your G Suite subscription, you'll see the days remaining in your G Suite trial. 1.2. You're on a Flexible Plan. If you have the Flexible Plan, you don't nee

Perspective Probe: Many Parts add up to a Whole Perspective
Apr 9, 2009 - the conversation around a sensitive topic instead of asking directly .... probe involved having participants complete several activities on their ...

Perspective Probe: Many Parts add up to a ... - googleusercontent.com
Apr 9, 2009 - ... the sensitive topic by breaking it into pieces and having each activity add to .... One theme that emerged was that at a high level participants' ...

Perspective Probe: Many Parts add up to a ... - googleusercontent.com
Apr 9, 2009 - ... at their brokerage site or sites such as Google Finance - that allow users to ... activities, we made a list of questions that we wanted to investigate, and ..... understanding anyone's social network in 60 minutes.” Proc. Of 2007

how to make a good reserach proposal
HOW TO MAKE A GOOD RESERACH. PROPOSAL. Wenxuan Hou. 1. Manchester Business School. 2005. 1 Contact information: [email protected]. 1 ...

Research Proposal: A Unified Approach to Scheduling ...
between tasks, and data dependencies between tasks and files. .... Many different types of grid computing systems have been developed over the years.

How to Add an Image to the Banner.pdf
Page 1 of 7. Adding an Image to the Banner. By the HSSD Tech Department. Step 1: Login to your account in upper right hand corner of the screen. Step 2: After ...

SASE-Submitting-a-Proposal
Log into your account at sase.org – green button “sign in” in the top right-hand corner of the homepage: ... Once you are logged in, you will see the green button “submit a paper” in the top right-hand corner of any page on the ... Conferen

How to add Flash movies and Flash video to a website
To add interest and interactivity, you can add movies created in Adobe Flash CS5 and Flash video to your site. Flash movies contain animated and interactive ...

InfoPath and workflow to create and add new items to a child list.pdf ...
On Button Click has Action submit and switch views. Page 3 of 11. InfoPath and workflow to create and add new items to a child list.pdf. InfoPath and workflow to create and add new items to a child list.pdf. Open. Extract. Open with. Sign In. Main me

How to add Flash movies and Flash video to a website
How to add Flash movies and Flash video to a website. To add interest and interactivity, you can add movies created in Adobe Flash CS5 and Flash video to ...

Video transcoding in a Grid network with User ...
transcodification service using a Grid architecture and User Controlled LightPaths .... communities cannot use the public Internet to carry out their experiments; they ... receives from a switch or network cloud using a specific network protocol ...

Add shift to -
not cycle with the data, the mask indices need to be updated whenever the buffer is cycled. - A programmer might need to shift elements in non-circular buffers ...

A Modest Proposal
already devoured most of the parents, seem to have the best title to the children. ... generally tough and lean, like that of our school-boys, by continual exercise, and ... work, and consequently pine away from want of nourishment, to a degree, that

A Modest Proposal
well of the public, as to have his statue set up for a preserver of the nation. .... as fast as can be reasonably expected. And as to the young .... rent without money or trade, the want of common sustenance, with neither house nor clothes to cover.