<commit_before>"use strict";

(function(){
	
	function TileBankTileEncoder() {		
	}
	
	TileBankTileEncoder.prototype = _.extend(new TileSetEncoders.BaseEncoder(), {
		getName: function() {
			return "Tile bank plus tile streaming";
		},
		
		doEncoding: function(converted, originalVideo) {
			converted.format = 'STREAM_TILE_MAPVH';

			var firstStepEncoding = new TileSetEncoders.MirroredTileEncoder().encode(originalVideo);
			converted.frames = firstStepEncoding.frames;
		}		
	});
	
	window.TileSetEncoders.register('TileBankTileEncoder', TileBankTileEncoder);
	
})();<commit_msg>Pick the tiles that are used more than once<commit_after>"use strict";

(function(){
	
	function TileBankTileEncoder() {		
	}
	
	TileBankTileEncoder.prototype = _.extend(new TileSetEncoders.BaseEncoder(), {
		getName: function() {
			return "Tile bank plus tile streaming";
		},
		
		doEncoding: function(converted, originalVideo) {
			converted.format = 'TILEBANK_MAPVH';

			var firstStepEncoding = new TileSetEncoders.MirroredTileEncoder().encode(originalVideo);
			
			// The tileBank contains the tiles that are used more than once; the others become part of the video stream.
			converted.tileBank = _.chain(firstStepEncoding.frames)
					.pluck('tiles').flatten().countBy().pairs()
					.filter(function(pair){ return pair[1] > 1 }).pluck(0)
					.sort().value();
			
			converted.frames = firstStepEncoding.frames;
		}		
	});
	
	window.TileSetEncoders.register('TileBankTileEncoder', TileBankTileEncoder);
	
})();
{'fraction_non_alphanumeric': 0.12350597609561753, 'fraction_numerical': 0.00199203187250996, 'mean_word_length': 4.602230483271375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2950660', 'n_tokens_mistral': 530, 'n_tokens_neox': 453, 'n_words': 94}