| OLD | NEW | 
|---|
| 1 @TEMPLATE decoder_tmpl.c | 1 @TEMPLATE decoder_tmpl.c | 
| 2 Postprocessing Decoder | 2 Postprocessing Decoder | 
| 3 ====================== | 3 ====================== | 
| 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION | 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION | 
| 5 This example adds postprocessing to the simple decoder loop. | 5 This example adds postprocessing to the simple decoder loop. | 
| 6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION | 6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION | 
| 7 | 7 | 
| 8 | 8 | 
| 9 Initializing Postprocessing | 9 Initializing Postprocessing | 
| 10 --------------------------- | 10 --------------------------- | 
| 11 You must inform the codec that you might request postprocessing at | 11 You must inform the codec that you might request postprocessing at | 
| 12 initialization time. This is done by passing the VPX_CODEC_USE_POSTPROC | 12 initialization time. This is done by passing the VPX_CODEC_USE_POSTPROC | 
| 13 flag to `vpx_codec_dec_init`. If the codec does not support | 13 flag to `vpx_codec_dec_init`. If the codec does not support | 
| 14 postprocessing, this call will return VPX_CODEC_INCAPABLE. For | 14 postprocessing, this call will return VPX_CODEC_INCAPABLE. For | 
| 15 demonstration purposes, we also fall back to default initialization if | 15 demonstration purposes, we also fall back to default initialization if | 
| 16 the codec does not provide support. | 16 the codec does not provide support. | 
| 17 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT | 17 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT | 
| 18 /* Initialize codec */ | 18 /* Initialize codec */ | 
| 19 res = vpx_codec_dec_init(&codec, interface, NULL, | 19 res = vpx_codec_dec_init(&codec, interface, NULL, | 
| 20                          VPX_CODEC_USE_POSTPROC); | 20                          VPX_CODEC_USE_POSTPROC); | 
| 21 if(res == VPX_CODEC_INCAPABLE) { | 21 if(res == VPX_CODEC_INCAPABLE) { | 
| 22     printf("NOTICE: Postproc not supported by %s\n", | 22     printf("NOTICE: Postproc not supported by %s\n", | 
| 23            vpx_codec_iface_name(interface)); | 23            vpx_codec_iface_name(interface)); | 
| 24     res = vpx_codec_dec_init(&codec, interface, NULL, 0); | 24     res = vpx_codec_dec_init(&codec, interface, NULL, flags); | 
| 25 } | 25 } | 
| 26 if(res) | 26 if(res) | 
| 27     die_codec(&codec, "Failed to initialize decoder"); | 27     die_codec(&codec, "Failed to initialize decoder"); | 
| 28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT | 28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT | 
| 29 | 29 | 
| 30 | 30 | 
| 31 Using Adaptive Postprocessing | 31 Using Adaptive Postprocessing | 
| 32 ----------------------------- | 32 ----------------------------- | 
| 33 VP6 provides "adaptive postprocessing." It will automatically select the | 33 VP6 provides "adaptive postprocessing." It will automatically select the | 
| 34 best postprocessing filter on a frame by frame basis based on the amount | 34 best postprocessing filter on a frame by frame basis based on the amount | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 58     if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) | 58     if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) | 
| 59         die_codec(&codec, "Failed to turn off postproc"); | 59         die_codec(&codec, "Failed to turn off postproc"); | 
| 60 } else if(frame_cnt%30 == 16) { | 60 } else if(frame_cnt%30 == 16) { | 
| 61     vp8_postproc_cfg_t  pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK, 4, 0}; | 61     vp8_postproc_cfg_t  pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK, 4, 0}; | 
| 62 | 62 | 
| 63     if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) | 63     if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) | 
| 64         die_codec(&codec, "Failed to turn on postproc"); | 64         die_codec(&codec, "Failed to turn on postproc"); | 
| 65 }; | 65 }; | 
| 66 #endif | 66 #endif | 
| 67 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE | 67 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE | 
| OLD | NEW | 
|---|