swscale: Force full horizontal chroma internally when the output has a odd size.
This fixes a gray line on the right side due to 1 column of pixels being skiped. Fixes Ticket891 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		
							parent
							
								
									84d0fcf268
								
							
						
					
					
						commit
						ba6e36f906
					
				@ -850,7 +850,14 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
 | 
				
			|||||||
    getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat);
 | 
					    getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // reuse chroma for 2 pixels RGB/BGR unless user wants full chroma interpolation
 | 
					    // reuse chroma for 2 pixels RGB/BGR unless user wants full chroma interpolation
 | 
				
			||||||
    if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) c->chrDstHSubSample=1;
 | 
					    if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) {
 | 
				
			||||||
 | 
					        if (dstW&1) {
 | 
				
			||||||
 | 
					            av_log(c, AV_LOG_DEBUG, "Forcing full internal H chroma due to odd output size\n");
 | 
				
			||||||
 | 
					            flags |= SWS_FULL_CHR_H_INT;
 | 
				
			||||||
 | 
					            c->flags = flags;
 | 
				
			||||||
 | 
					        } else
 | 
				
			||||||
 | 
					            c->chrDstHSubSample = 1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // drop some chroma lines if the user wants it
 | 
					    // drop some chroma lines if the user wants it
 | 
				
			||||||
    c->vChrDrop= (flags&SWS_SRC_V_CHR_DROP_MASK)>>SWS_SRC_V_CHR_DROP_SHIFT;
 | 
					    c->vChrDrop= (flags&SWS_SRC_V_CHR_DROP_MASK)>>SWS_SRC_V_CHR_DROP_SHIFT;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user