<commit_before>// 
// (C) <NAME> 2007-2009, all rights reserved. See the accompanying "License.txt" for licensed use. 
// 

#ifndef CHARLS_ENCODERSTRATEGY
#define CHARLS_ENCODERSTRATEGY

#include "processline.h"
#include "decoderstrategy.h"

class EncoderStrategy
{

public:
	explicit EncoderStrategy(const JlsParamaters& info) :
		 _qdecoder(0),
		 _info(info),
		 _processLine(0),
 		 valcurrent(0),
		 bitpos(0),
		 _bFFWritten(false),
		 _cbyteWritten(0)
		
	{
	}

	virtual ~EncoderStrategy() 
	{
	    delete _processLine;
	}

	LONG PeekByte();
	
	void OnLineBegin(LONG cpixel, void* ptypeBuffer, LONG pixelStride)
	{
		_processLine->NewLineRequested(ptypeBuffer, cpixel, pixelStride);
	}

	void OnLineEnd(LONG cpixel, void* ptypeBuffer, LONG pixelStride) {}

    virtual void SetPresets(const JlsCustomParameters& presets) = 0;
		<commit_msg>Memory leak when using VerifyEncode<commit_after>// 
// (C) <NAME> 2007-2009, all rights reserved. See the accompanying "License.txt" for licensed use. 
// 

#ifndef CHARLS_ENCODERSTRATEGY
#define CHARLS_ENCODERSTRATEGY

#include "processline.h"
#include "decoderstrategy.h"

class EncoderStrategy
{

public:
	explicit EncoderStrategy(const JlsParamaters& info) :
		 _qdecoder(0),
		 _info(info),
		 _processLine(0),
 		 valcurrent(0),
		 bitpos(0),
		 _bFFWritten(false),
		 _cbyteWritten(0)
		
	{
	}

	virtual ~EncoderStrategy() 
	{
		delete _qdecoder;
	    delete _processLine;
	}

	LONG PeekByte();
	
	void OnLineBegin(LONG cpixel, void* ptypeBuffer, LONG pixelStride)
	{
		_processLine->NewLineRequested(ptypeBuffer, cpixel, pixelStride);
	}

	void OnLineEnd(LONG cpixel, void* ptypeBuffer, LONG pixelStride) {}

    virtual void SetPresets(const JlsCustomParameters& presets) = 0;
		
{'fraction_non_alphanumeric': 0.1077188940092166, 'fraction_numerical': 0.016129032258064516, 'mean_word_length': 4.514285714285714, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5785558', 'n_tokens_mistral': 691, 'n_tokens_neox': 598, 'n_words': 136}